mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-06 00:02:08 -04:00
bugfix: digest auth enabled session wasn't working if session did not have digest credentials setup yet
This commit is contained in:
parent
ba21f83827
commit
ee4caa552b
@ -39,10 +39,7 @@ module HTTPX
|
||||
requests.flat_map do |request|
|
||||
digest = request.options.digest
|
||||
|
||||
unless digest
|
||||
super(request)
|
||||
next
|
||||
end
|
||||
next super(request) unless digest
|
||||
|
||||
probe_response = wrap { super(request).first }
|
||||
|
||||
|
@ -44,6 +44,14 @@ module Requests
|
||||
end
|
||||
end
|
||||
|
||||
def test_plugin_digest_authentication_bypass
|
||||
session = HTTPX.plugin(:digest_authentication).with_headers("cookie" => "fake=fake_value")
|
||||
response = session.get(digest_auth_uri)
|
||||
verify_status(response, 401)
|
||||
response = session.get(build_uri("/get"))
|
||||
verify_status(response, 200)
|
||||
end
|
||||
|
||||
# NTLM
|
||||
|
||||
def test_plugin_ntlm_authentication
|
||||
|
Loading…
x
Reference in New Issue
Block a user