Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests module does not handle redirects by default. #109

Open
SimSama opened this issue Aug 5, 2022 · 0 comments
Open

Requests module does not handle redirects by default. #109

SimSama opened this issue Aug 5, 2022 · 0 comments

Comments

@SimSama
Copy link

SimSama commented Aug 5, 2022

Hi friends,

Just a heads up, I noticed a TAXII 2.0 feed hosted by Anomali returns a 301 redirect to the actual endpoint. Since you use raise_for_status in the code it expects a 2xx error code to assume success.

Endpoint advertised by Anomli: https://limo.anomali.com/taxii
Redirection point: https://limo.anomali.com/api/v1/taxii2/taxii/
General info (its free): https://www.anomali.com/resources/limo

Also one other quirk about requests is even if you handle this, the redirected endpoint doesn't get the authentication passed on. There is a workaround where you have to retrieve the redirect response location header value, and rebuild the request with auth. Since you are using session maybe you don't need to do that.

Anyways this will inevitably frustrate someone to no end, I ended up building my own version of a TAXII2.x client in python to work around this issue. If you get some time to fix.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant