Permalink
Browse files

Fixed multipart parameter parsing for when a field's body ends at the…

… same time as a chunk (i.e. we've reached EOL and buffer is empty)
  • Loading branch information...
Derek and Matt authored and josh committed Nov 16, 2009
1 parent 0a90548 commit a9440bc752be9b3093669614c6b56bf78d592958
Showing with 273 additions and 4 deletions.
  1. +2 −4 lib/rack/utils.rb
  2. +259 −0 test/multipart/bad_robots
  3. +12 −0 test/spec_rack_utils.rb
View
@@ -482,9 +482,6 @@ def self.parse_multipart(env)
body << buf.slice!(0, i)
buf.slice!(0, boundary_size+2)
- # If sliced exactly at boundary, let's move:
- next if buf.empty? && ($1 == EOL)
-
content_length = -1 if $1 == "--"
end
@@ -515,7 +512,8 @@ def self.parse_multipart(env)
Utils.normalize_params(params, name, data) unless data.nil?
- break if buf.empty? || content_length == -1
+ # break if we're at the end of a buffer, but not if it is the end of a field
+ break if (buf.empty? && $1 != EOL) || content_length == -1
}
input.rewind
View
@@ -0,0 +1,259 @@
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="bbbbbbbbbbbbbbb"
+
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaa
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+aaaaaaaaaaaaaaaaaaaa
+
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="ccccccc"
+
+ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="file.name"
+
+INPUTMSG.gz
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="file.content_type"
+
+application/octet-stream
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="file.path"
+
+/var/tmp/uploads/4/0001728414
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="file.md5"
+
+aa73198feb4b4c1c3186f5e7466cbbcc
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="file.size"
+
+13212
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="size"
+
+80892
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="mail_server_id"
+
+<1111111111.22222222.3333333333333.JavaMail.app@ffff-aaaa.dddd>
+
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="addresses"
+
+{"campsy_programmer@pinkedum.com":{"domain":"pinkedum.com","name":"Campsy Programmer","type":["env_sender"],"mailbox":"campsy_programmer"},"tex@rapidcity.com":{"domain":"rapidcity.com","name":"Big Tex","type":["env_recipients","to"],"mailbox":"tex"},"group-digests@linkedin.com":{"domain":"linkedin.com","name":"Group Members","type":["from"],"mailbox":"group-digests"}}
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="received_on"
+
+2009-11-15T14:21:11Z
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="id"
+
+dbfd9804d26d11deab24e3037639bf77
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon
+Content-Disposition: form-data; name="ip_address"
+
+127.0.0.1
+--1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon--
View
@@ -462,6 +462,18 @@ def context env, app=@app; app.call(env); end
params["people"][0]["files"][:filename].should.equal "file1.txt"
params["people"][0]["files"][:tempfile].read.should.equal "contents"
end
+
+ specify "can parse fields that end at the end of the buffer" do
+ input = File.read(multipart_file("bad_robots"))
+
+ req = Rack::Request.new Rack::MockRequest.env_for("/",
+ "CONTENT_TYPE" => "multipart/form-data, boundary=1yy3laWhgX31qpiHinh67wJXqKalukEUTvqTzmon",
+ "CONTENT_LENGTH" => input.size,
+ :input => input)
+
+ req.POST['file.path'].should.equal "/var/tmp/uploads/4/0001728414"
+ req.POST['addresses'].should.not.equal nil
+ end
specify "builds complete params with the chunk size of 16384 slicing exactly on boundary" do
data = File.open(multipart_file("fail_16384_nofile")) { |f| f.read }.gsub(/\n/, "\r\n")

0 comments on commit a9440bc

Please sign in to comment.