firehoseio / firehose

Build realtime Ruby web applications. Created by the fine folks at Poll Everywhere.
http://firehose.io/
MIT License
726 stars 72 forks source link

Use `String#bytesize` for `Content-Length` instead of `String#size` #76

Closed andrewhampton closed 5 years ago

andrewhampton commented 5 years ago

String#size returns the character count with multi-byte characters counting as 1. However, Content-Length is expecting the length of the body in bytes. String#bytesize is the correct method to use here.