From ec1bca238e2ea6bca3fd641a36d2bc821e0bda95 Mon Sep 17 00:00:00 2001 From: HuaYang Huang Date: Wed, 1 Apr 2015 17:54:22 +0800 Subject: [PATCH] fix: httpc.post MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调用httpc.post时,如果没有在header里面设置host时有问题 --- lualib/http/httpc.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lualib/http/httpc.lua b/lualib/http/httpc.lua index 823d33b5..a8b7d6f8 100644 --- a/lualib/http/httpc.lua +++ b/lualib/http/httpc.lua @@ -16,6 +16,8 @@ local function request(fd, method, host, url, recvheader, header, content) end if header.host then host = "" + else + host = string.format("host:%s\r\n", host) end else host = string.format("host:%s\r\n",host)