Skip to content
Browse files

parse_multipart: Content-Type field doesn't imply a file upload

Fixes issues created by 6674f36.  [#79 state:resolved]
  • Loading branch information...
leahneukirchen committed Feb 7, 2010
1 parent a6320b9 commit acffe8ef5ea6de74fe306f2dd908b7681a21aaad
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rack/utils.rb
@@ -503,7 +503,7 @@ def self.parse_multipart(env)
content_type = head[/Content-Type: (.*)#{EOL}/ni, 1]
name = head[/Content-Disposition:.*\s+name="?([^\";]*)"?/ni, 1] || head[/Content-ID:\s*([^#{EOL}]*)/ni, 1]

if content_type || filename
if filename
body ="RackMultipart")
body.binmode if body.respond_to?(:binmode)

1 comment on commit acffe8e


This comment has been minimized.

Copy link

seven1m commented on acffe8e Jan 29, 2011

I think this broke something. Before this change, POSTS could have a multipart body with regular parameters inside (no filename= part). Now they cannot. Every parameter in the body must have a filename, otherwise line 548 (body.rewind) throws an exception: "Undefined method rewind for String."

Please sign in to comment.
You can’t perform that action at this time.