mirror of
				https://github.com/lunarmodules/luasocket.git
				synced 2025-10-31 02:15:38 +01:00 
			
		
		
		
	Fix Host: header according to RFC7230
This commit is contained in:
		| @@ -209,8 +209,7 @@ end | |||||||
|  |  | ||||||
| local function adjustheaders(reqt) | local function adjustheaders(reqt) | ||||||
|     -- default headers |     -- default headers | ||||||
|     local host = reqt.host |     local host = string.gsub(reqt.authority, "^.-@", "") | ||||||
|     if reqt.port then host = host .. ":" .. reqt.port end |  | ||||||
|     local lower = { |     local lower = { | ||||||
|         ["user-agent"] = _M.USERAGENT, |         ["user-agent"] = _M.USERAGENT, | ||||||
|         ["host"] = host, |         ["host"] = host, | ||||||
| @@ -353,4 +352,4 @@ _M.request = socket.protect(function(reqt, body) | |||||||
|     else return trequest(reqt) end |     else return trequest(reqt) end | ||||||
| end) | end) | ||||||
|  |  | ||||||
| return _M | return _M | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user