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

304 causes exception and 500 to be returned #56

Open
binbrain opened this issue May 16, 2015 · 1 comment
Open

304 causes exception and 500 to be returned #56

binbrain opened this issue May 16, 2015 · 1 comment
Labels

Comments

@binbrain
Copy link

When IF-MODIFIED-SINCE HTTP header causes WebOb to set a 304 status code, bowerstatic as a tween causes an error because it tries to check the content. When it does so, it raises an exception which turns into a 500 instead of the 304. The 304 is supposed to be returned to the browser.

injector.py:

if response.content_type.lower() not in CONTENT_TYPES:

This throws an an exception.

AttributeError: 'NoneType' object has no attribute 'lower'

response.content_type has been set to empty since a 304 doesn't return content. I think if call sees a 304 it should just immediately return response.

@faassen
Copy link
Owner

faassen commented May 25, 2015

+1. Care to come up with a pull request for this (with a test for this scenario)?

@faassen faassen added the bug label May 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants