You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an application I need to reach behind a firewall, I've set up a tunnel to this application via SSH running on my machine which forwards all connections from 127.0.0.1:1234 to 192.168.1.10:80. Whenever I make a request to my application, it redirects me to a login page first.
The issue with this is that all redirect URL's have the 192.168.1.10 hostname, which requests tries to follow and inevitably crashes (as this host does not exist on my network).
I tried to set allow_redirects to False on my session by overriding the request method, but the session source hard-codes the allow_redirects option to True if it isn't explicitly set when calling get, head and options (source)
Expected Result
I expected no redirect to be followed, but rather that that the request ends after the first response. I expected the allow_redirects option to be configurable in sessions like the verify flag is (source)
Actual Result
The 302 was resolved, and attempted to redirect me to a nonexistent host, leading to a connection error exception.
I have an application I need to reach behind a firewall, I've set up a tunnel to this application via SSH running on my machine which forwards all connections from
127.0.0.1:1234
to192.168.1.10:80
. Whenever I make a request to my application, it redirects me to a login page first.The issue with this is that all redirect URL's have the
192.168.1.10
hostname, which requests tries to follow and inevitably crashes (as this host does not exist on my network).I tried to set
allow_redirects
toFalse
on my session by overriding therequest
method, but the session source hard-codes theallow_redirects
option toTrue
if it isn't explicitly set when callingget
,head
andoptions
(source)Expected Result
I expected no redirect to be followed, but rather that that the request ends after the first response. I expected the
allow_redirects
option to be configurable in sessions like theverify
flag is (source)Actual Result
The 302 was resolved, and attempted to redirect me to a nonexistent host, leading to a connection error exception.
Reproduction Steps
System Information
The text was updated successfully, but these errors were encountered: