-
Notifications
You must be signed in to change notification settings - Fork 64
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
asks crashes on a 304 Not Modified response #133
Comments
It looks like urllib3 uses: REDIRECT_STATUSES = [301, 302, 303, 307, 308] |
Yeah I'm working on a branch here dealing with redirects at the moment. There's...a bit of debt to be paid. Ty for report :D |
I hear ya... |
I've just been bitten by this. No progress yet? |
Sorry. New position and swamped lately. If you've time happy to take a pr, should be simple. I can get to it Sunday if not. |
Updates? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like asks assumes that all 3xx responses are redirects, and should have Location: headers. But 304 Not Modified isn't a redirect. It happens when the requester uses some headers like
If-Modified-Since
orIf-None-Match
to tell the server that they already have a local copy, and the server is saying "yep, that local copy you have is still good, you should just use that".Right now, when this happens, asks raises a
KeyError
exception because it tries to look upresponse_obj.headers["Location"]
, but it's not there.I think the right thing to do is to treat 304 like a normal successful response, and just return it unchanged to the user. If they're using cache headers, then they're presumably prepared to handle this response.
The text was updated successfully, but these errors were encountered: