One Day Sec

Why does using `allow_redirects=False` in the Python requests module not work for Fortigate VPN page version detection?

The `allow_redirects=False` parameter only disables redirection when the HTTP status code is 301 or 302. In the case of Fortigate VPN login page, the redirect is returned with a status code of 200, so the parameter has no effect. Instead, you must manually parse the redirect URL from the response body using regex. This nuance is important for accurate Fortigate identification and version detection.
allow_redirectsredirect handlingHTTP status codePython requests

Browse all Q&A →