From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5EAB225F51 for ; Tue, 5 Feb 2019 06:43:01 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n0zVUuV4f4ps for ; Tue, 5 Feb 2019 06:43:01 -0500 (EST) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 99FBE24987 for ; Tue, 5 Feb 2019 06:43:00 -0500 (EST) Subject: [tarantool-patches] Re: [PATCH] httpc: add checking of headers in httpc:request References: <20181221181844.4417-1-roman.habibov@tarantool.org> <20181223031929.hhmxdlsox2aon5ih@tkn_work_nb> <3b2626ce-b887-70dd-38b0-ef38b37a983c@tarantool.org> <72bbdfde-54d7-0e94-c5e7-ca84c2a6078d@tarantool.org> <7f31300f-2e4a-f0b1-a40c-90d631fb9778@tarantool.org> From: Vladislav Shpilevoy Message-ID: <2e5f83a6-2885-96f8-6fd6-a5fd34e32644@tarantool.org> Date: Tue, 5 Feb 2019 14:42:56 +0300 MIME-Version: 1.0 In-Reply-To: <7f31300f-2e4a-f0b1-a40c-90d631fb9778@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Roman , tarantool-patches@freelists.org, Alexander Turenko 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 can be ... '. > +local function test_request_headers(test, url, opts) > +    local exp_err = 'can\'t convert header to a string' > +    local cases = { > +        {