Skip to content

Commit

Permalink
Fix Host: header according to RFC7230
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Nehab committed Jul 15, 2014
1 parent 6d5e40c commit d80bb0d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -353,4 +352,4 @@ _M.request = socket.protect(function(reqt, body)
else return trequest(reqt) end
end)

return _M
return _M

0 comments on commit d80bb0d

Please sign in to comment.