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

force headers to be str in flask response for login #13

Merged
merged 1 commit into from
Oct 16, 2013

Conversation

joetsoi
Copy link
Collaborator

@joetsoi joetsoi commented Oct 16, 2013

Without explicity forcing the response headers to be str types, I get 500 a error (logs show aTypeError: expected byte string object for header name, value of type unicode found) when attempting to use the login view/page with apache/mod_wsgi. Each time you declare a string in the login view it becomes a unicode string, I'm guessing this is a werkzeug/flask thing, but I must admit, I don't really know why this happens.

mod_wsgi expects response headers to be byte strings and fails with a
TypeError as the headers seem to automagically get converted to unicode
joetsoi added a commit that referenced this pull request Oct 16, 2013
force headers to be str in flask response for login
@joetsoi joetsoi merged commit 70aa189 into master Oct 16, 2013
@joetsoi joetsoi deleted the force-headers-str branch October 16, 2013 12:42
amercader added a commit that referenced this pull request Jan 24, 2014
Same situation as in #13, but with the headers returned when there is an
exception, eg malformed JSON.
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

Successfully merging this pull request may close these issues.

None yet

1 participant