-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add allow_redirects
option to FastHttpSession.request
#1238
Comments
It is super annoying, but I dont think geventhttpclient supports this, so I'm not sure we can build it (without patching geventhttpclient, which is of course possible, but pretty dirty...) |
Actually, there might be a way. I was looking for a way to control timeouts and found a setting for redirects as well. I'll get back to you... |
I found a (dirty) workaround. Before your request (preferably in the TaskSet.on_start() method or something) do this:
GeventHttpClient will no longer recognize the response as a redirect and you'll be able to investigate the initial response in all its glory. |
Since we’re already wrapping the geventhttpclient, I think we could implement support for an |
@heyman any update on this ? |
@masthijohna Nope, not that I know of. |
Fixed! |
…to-FastHttpLocust.client.request() Add allow_redirects parameter to FastHttpLocust.client.request(). Fixes #1238
Is your feature request related to a problem? Please describe.
I'm trying to convert my use of HttpLocust to FastHttpLocust, but I am unable to do so because my code critically relies on being able to set
allow_redirects
to False.Describe the solution you'd like
I want an
allow_redirects
option supported in FastHttpSession.request such that passing the value True (or not passing a value at all) will automatically perform redirects from a 3xx response and passing the value False will not perform any redirect resulting from a 3xx response.Describe alternatives you've considered
I have considered looking at the Referer/Location that comes back, however I'm unable to inspect the headers after the redirect has been performed. I'm also unable to find the current location after the response has been completed.
Additional context
I need to parse the location URL where the response is saying to redirect.
The text was updated successfully, but these errors were encountered: