From d80bb0d82ba105c8fdb27e6174c267965d06ffb0 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Tue, 15 Jul 2014 14:49:20 -0300 Subject: [PATCH] Fix Host: header according to RFC7230 --- src/http.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/http.lua b/src/http.lua index 1d0eb50..d5457f6 100644 --- a/src/http.lua +++ b/src/http.lua @@ -209,8 +209,7 @@ end local function adjustheaders(reqt) -- default headers - local host = reqt.host - if reqt.port then host = host .. ":" .. reqt.port end + local host = string.gsub(reqt.authority, "^.-@", "") local lower = { ["user-agent"] = _M.USERAGENT, ["host"] = host, @@ -353,4 +352,4 @@ _M.request = socket.protect(function(reqt, body) else return trequest(reqt) end end) -return _M \ No newline at end of file +return _M