jruby / jruby-rack

Rack for JRuby and Java appservers
MIT License
397 stars 136 forks source link

Use encoding and CR-aware concatenation #248

Closed headius closed 4 months ago

headius commented 4 months ago

The old cat method used here does not consider encodings or code ranges, instead just slamming the given bytes directly into the existing buffer. This causes problem when those bytes or the encoding they came from does not match the existing encoding or code range, leading to issues like jruby/jruby-rack#247.

The fix here uses a code range-aware method for doing the bytes concatenation, and resolved the related bug.

Fixes jruby/jruby-rack#247