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

Change Content-Length header computation to be based on a number of bytes #9

Conversation

michaelbaudino
Copy link

... instead of a number of characters (which is not always the same, e.g. with accented characters)

The bug appeared when using Middleman (the gem middleman-minify-html uses htmlcompressor). See here : http://forum.middlemanapp.com/t/middleman-minify-html-content-length-header-error/697

Also, check this IRB session for a quick example:

2.0.0-p247 :001 > 'é'.length
=> 1
2.0.0-p247 :002 > 'é'.bytesize
=> 2

…ytes, instead of a number of characters (which is not always the same, e.g. with accented characters)
@michaelbaudino
Copy link
Author

Crap, I just saw #7 which is exactly the same fix :-/

@paolochiodi
Copy link
Owner

fixed in #7
thank you

@paolochiodi paolochiodi closed this Jul 8, 2013
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

2 participants