Skip to content

Commit

Permalink
use uppercase "type" for Proxy-Authorization header (#19273)
Browse files Browse the repository at this point in the history
Some servers will reject authorization requests with a lowercase "basic" type. Changing to "Basic" seems to solve these issues.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization
(cherry picked from commit b812431)
  • Loading branch information
vercingetorx authored and narimiran committed Dec 20, 2021
1 parent 095202e commit efdb180
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pure/httpclient.nim
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ proc generateHeaders(requestUrl: Uri, httpMethod: HttpMethod, headers: HttpHeade
# Proxy auth header.
if not proxy.isNil and proxy.auth != "":
let auth = base64.encode(proxy.auth)
add(result, "Proxy-Authorization: basic " & auth & httpNewLine)
add(result, "Proxy-Authorization: Basic " & auth & httpNewLine)

for key, val in headers:
add(result, key & ": " & val & httpNewLine)
Expand Down

0 comments on commit efdb180

Please sign in to comment.