Skip to content

Commit e5f3041

Browse files
authored
Merge pull request #248 from headius/encoding_aware_cat
Use encoding and CR-aware concatenation
2 parents 710c1a4 + 3319527 commit e5f3041

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/jruby/rack/ext/Input.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.jruby.rack.RackEnvironment;
3030
import org.jruby.rack.servlet.RewindableInputStream;
3131
import org.jruby.rack.util.ExceptionUtils;
32+
import org.jruby.util.StringSupport;
3233

3334
/**
3435
* Native (Java) implementation of a Rack input.
@@ -143,7 +144,7 @@ public IRubyObject read(final ThreadContext context, final IRubyObject[] args) {
143144
if ( bytes != null ) {
144145
if ( buffer != null ) {
145146
buffer.clear();
146-
buffer.cat(bytes);
147+
buffer.catWithCodeRange(new ByteList(bytes, false), StringSupport.CR_UNKNOWN);
147148
return buffer;
148149
}
149150
return context.runtime.newString(new ByteList(bytes, false));

0 commit comments

Comments
 (0)