mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
teach proxy server to challenge unauthenticated requests
HTTPClient needs this challenge to retry with Basic authentication, otherwise it won't attempt authentication at all.
This commit is contained in:
parent
0a1deaf173
commit
d0b01a9b31
@ -27,6 +27,7 @@ webrick_opts = {
|
||||
if username
|
||||
type, credentials = req.header['proxy-authorization'].first.to_s.split(/\s+/, 2)
|
||||
unless "Basic" == type && match_credentials.call(credentials)
|
||||
res['proxy-authenticate'] = %{Basic realm="testing"}
|
||||
raise WEBrick::HTTPStatus::ProxyAuthenticationRequired
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user