mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-25 12:08:21 +01:00
Fix Host: header according to RFC7230
This commit is contained in:
parent
6d5e40c324
commit
d80bb0d82b
@ -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
|
||||
return _M
|
||||
|
Loading…
Reference in New Issue
Block a user