lib/httpx/plugins/ntlm_authentication.rb in httpx-0.22.1 vs lib/httpx/plugins/ntlm_authentication.rb in httpx-0.22.2
- old
+ new
@@ -37,9 +37,11 @@
if ntlm
request.headers["authorization"] = ntlm.negotiate
probe_response = wrap { super(request).first }
+ return probe_response unless probe_response.is_a?(Response)
+
if probe_response.status == 401 && ntlm.can_authenticate?(probe_response.headers["www-authenticate"])
request.transition(:idle)
request.headers["authorization"] = ntlm.authenticate(request, probe_response.headers["www-authenticate"])
super(request)
else