diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/http.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/http.lua b/src/http.lua index 204a841..2b4a45e 100644 --- a/src/http.lua +++ b/src/http.lua | |||
| @@ -222,6 +222,15 @@ local function adjustheaders(reqt) | |||
| 222 | lower["authorization"] = | 222 | lower["authorization"] = |
| 223 | "Basic " .. (mime.b64(reqt.user .. ":" .. reqt.password)) | 223 | "Basic " .. (mime.b64(reqt.user .. ":" .. reqt.password)) |
| 224 | end | 224 | end |
| 225 | -- if we have proxy authentication information, pass it along | ||
| 226 | local proxy = reqt.proxy or _M.PROXY | ||
| 227 | if proxy then | ||
| 228 | proxy = url.parse(proxy) | ||
| 229 | if proxy.user and proxy.password then | ||
| 230 | lower["proxy-authorization"] = | ||
| 231 | "Basic " .. (mime.b64(proxy.user .. ":" .. proxy.password)) | ||
| 232 | end | ||
| 233 | end | ||
| 225 | -- override with user headers | 234 | -- override with user headers |
| 226 | for i,v in base.pairs(reqt.headers or lower) do | 235 | for i,v in base.pairs(reqt.headers or lower) do |
| 227 | lower[string.lower(i)] = v | 236 | lower[string.lower(i)] = v |
