Skip to content

Commit

Permalink
Merge pull request #248 from headius/encoding_aware_cat
Browse files Browse the repository at this point in the history
Use encoding and CR-aware concatenation
  • Loading branch information
headius authored May 23, 2024
2 parents 710c1a4 + 3319527 commit e5f3041
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/jruby/rack/ext/Input.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.jruby.rack.RackEnvironment;
import org.jruby.rack.servlet.RewindableInputStream;
import org.jruby.rack.util.ExceptionUtils;
import org.jruby.util.StringSupport;

/**
* Native (Java) implementation of a Rack input.
Expand Down Expand Up @@ -143,7 +144,7 @@ public IRubyObject read(final ThreadContext context, final IRubyObject[] args) {
if ( bytes != null ) {
if ( buffer != null ) {
buffer.clear();
buffer.cat(bytes);
buffer.catWithCodeRange(new ByteList(bytes, false), StringSupport.CR_UNKNOWN);
return buffer;
}
return context.runtime.newString(new ByteList(bytes, false));
Expand Down

0 comments on commit e5f3041

Please sign in to comment.