mirror of
				https://github.com/lunarmodules/luasocket.git
				synced 2025-10-31 10:25:55 +01:00 
			
		
		
		
	Add proxy authentication headers if present.
This commit is contained in:
		| @@ -222,6 +222,15 @@ local function adjustheaders(reqt) | ||||
|         lower["authorization"] =  | ||||
|             "Basic " ..  (mime.b64(reqt.user .. ":" .. reqt.password)) | ||||
|     end | ||||
|     -- if we have proxy authentication information, pass it along | ||||
|     local proxy = reqt.proxy or _M.PROXY | ||||
|     if proxy then | ||||
|         proxy = url.parse(proxy) | ||||
|         if proxy.user and proxy.password then | ||||
|             lower["proxy-authorization"] =  | ||||
|                 "Basic " ..  (mime.b64(proxy.user .. ":" .. proxy.password)) | ||||
|         end | ||||
|     end | ||||
|     -- override with user headers | ||||
|     for i,v in base.pairs(reqt.headers or lower) do | ||||
|         lower[string.lower(i)] = v | ||||
|   | ||||
		Reference in New Issue
	
	Block a user