aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/http.lua5
1 files 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
209 209
210local function adjustheaders(reqt) 210local function adjustheaders(reqt)
211 -- default headers 211 -- default headers
212 local host = reqt.host 212 local host = string.gsub(reqt.authority, "^.-@", "")
213 if reqt.port then host = host .. ":" .. reqt.port end
214 local lower = { 213 local lower = {
215 ["user-agent"] = _M.USERAGENT, 214 ["user-agent"] = _M.USERAGENT,
216 ["host"] = host, 215 ["host"] = host,
@@ -353,4 +352,4 @@ _M.request = socket.protect(function(reqt, body)
353 else return trequest(reqt) end 352 else return trequest(reqt) end
354end) 353end)
355 354
356return _M \ No newline at end of file 355return _M