-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Response.calculate_content_length doesn't use encoded self.response #705
Comments
alexpantyukhin
added a commit
to alexpantyukhin/werkzeug
that referenced
this issue
Aug 13, 2016
alexpantyukhin
added a commit
to alexpantyukhin/werkzeug
that referenced
this issue
Aug 20, 2016
This was referenced Dec 7, 2017
This was referenced Jan 5, 2018
This was referenced Jan 15, 2018
This was referenced Jan 29, 2018
This was referenced Feb 5, 2018
This was referenced Feb 13, 2018
This was referenced Feb 26, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The implementation of
calculate_content_length
doesn't encode the elements ofself.response
before using them:https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/wrappers.py#L926
In case self.response is composed of utf-8 encoded unicode strings, this will lead to an invalid return length:
The easier solution to this would be to use
iter_encoded
insidecalculate_content_length
, but would decrease performances given the data would be encoded two time (for calculating content-lenght, then for actualy writing the data)The text was updated successfully, but these errors were encountered: