Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Roman <roman.habibov@tarantool.org>,
	tarantool-patches@freelists.org,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] httpc: add checking of headers in httpc:request
Date: Tue, 5 Feb 2019 14:42:56 +0300	[thread overview]
Message-ID: <2e5f83a6-2885-96f8-6fd6-a5fd34e32644@tarantool.org> (raw)
In-Reply-To: <7f31300f-2e4a-f0b1-a40c-90d631fb9778@tarantool.org>

Hi! Thanks for the fixes! See 3 comments below.

>> 4. In the commit message you said that 'nil' is ok, but here you did not
>> check for that and return an error. Of course, real nil can not appear in
>> a table, because it means absence of a value, but what about box.NULL?
> 
> Added test for this case, right?

1. Yes, you did, but the test fails. On my laptop http_client.test.lua
is totally broken for already a year at least, but I run the test from
console and got this:

     	tarantool> client = require('http.client')
	---
	...

	tarantool> http = client:new()
	---
	...

	tarantool> opts = {headers = {aaa = box.NULL}}
	---
	...

	tarantool> http:get('127.0.0.1:12345', opts)
	---
	- error: 'builtin/http.client.lua:299: can''t convert header to a string'

So box.NULL is not converted to string despite the fact that box.NULL == nil
and you said in the commit message

     "... Each header must be nil, 'string' or 'table' ..."

> 
> 
>> 5. Out of 80 symbols.

2. Still out of 80.

>>
>>> +                } else if (luaL_getmetafield(L, -1, "__tostring") == LUA_TNIL) {
> diff --git a/test/app-tap/http_client.test.lua b/test/app-tap/http_client.test.lua
> index 10a3728f8..f231c2e90 100755
> --- a/test/app-tap/http_client.test.lua
> +++ b/test/app-tap/http_client.test.lua
> @@ -205,6 +205,80 @@ local function test_errors(test)
>       test:is(r.status, 595, "GET: response on bad url")
>   end
> 
> +-- gh-3679 allow only headers can be converted to string

3. I am not a linguist, but the sentence looks grammatically
incorrect IMO. 'Allow only headers <something is missing> can be ... '.

> +local function test_request_headers(test, url, opts)
> +    local exp_err = 'can\'t convert header to a string'
> +    local cases = {
> +        {

  reply	other threads:[~2019-02-05 11:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 18:18 [tarantool-patches] " Roman Khabibov
2018-12-23  3:19 ` [tarantool-patches] " Alexander Turenko
2018-12-26 15:56   ` Roman
2018-12-29 10:30     ` Vladislav Shpilevoy
2019-01-09 13:29       ` Roman
2019-01-24 14:54         ` Roman
2019-01-29 19:44         ` Vladislav Shpilevoy
2019-01-29 20:32           ` Alexander Turenko
2019-01-31 23:47           ` Roman
2019-02-05 11:42             ` Vladislav Shpilevoy [this message]
2019-02-11 23:24               ` Roman
2019-02-15 21:17                 ` Vladislav Shpilevoy
2019-02-19 10:49                   ` Roman
2019-02-22 16:01                     ` Vladislav Shpilevoy
2019-02-23 21:38                       ` Roman Khabibov
2019-02-23 22:43                       ` Roman Khabibov
2019-02-25 13:04                         ` Vladislav Shpilevoy
2019-02-25 14:51 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e5f83a6-2885-96f8-6fd6-a5fd34e32644@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=roman.habibov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] httpc: add checking of headers in httpc:request' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox