summary refs log tree commit
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-27 18:47:59 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-28 07:44:04 -0700
commit4c057e7d79cd3244fe9649d4e81dab86156ade7d (patch)
treec8789a9ec6dcb1075655a9a9de1c7671b0f62c67
parent8653e7ad4182b3dacae247d24086e19e3d4f72d3 (diff)
downloadrack-4c057e7d79cd3244fe9649d4e81dab86156ade7d.tar.gz
content length should be the bytesize, not string length
The bytesize and string length differ in this case, and bytesize is the
correct value.
-rw-r--r--test/spec_multipart.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/spec_multipart.rb b/test/spec_multipart.rb
index b0ad2cb9..734d6f4e 100644
--- a/test/spec_multipart.rb
+++ b/test/spec_multipart.rb
@@ -1,5 +1,8 @@
 # coding: utf-8
 
+require 'minitest/autorun'
+require 'rack'
+require 'rack/multipart/parser'
 require 'rack/utils'
 require 'rack/mock'
 
@@ -640,7 +643,7 @@ Content-Type: image/png\r
 
     options = {
       "CONTENT_TYPE" => "multipart/related; boundary=AaB03x",
-      "CONTENT_LENGTH" => data.length.to_s,
+      "CONTENT_LENGTH" => data.bytesize.to_s,
       :input => StringIO.new(data)
     }
     env = Rack::MockRequest.env_for("/", options)