summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-01-29 10:33:09 -0800
committerJeremy Evans <code@jeremyevans.net>2020-01-29 10:39:50 -0800
commitc6104619d0e3c841c68bd7eefc613ca2376dcf58 (patch)
tree501140ef8bc77a3c2d911de4519a925d3a815470
parent549412368a9429cab0c81dffa99402cfbb2411e5 (diff)
downloadrack-c6104619d0e3c841c68bd7eefc613ca2376dcf58.tar.gz
Remove dead code in multipart parser
This can only be hit if filename is nil/false. However, when the MimePart is created, it is either a TempfilePart if there is a filename or a BufferPart otherwise. In the TempfilePart case, the filename is present so this code is not hit. In the BufferPart case, the body is a String and not an IO, so this cannot be hit.
-rw-r--r--lib/rack/multipart/parser.rb6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/rack/multipart/parser.rb b/lib/rack/multipart/parser.rb
index 28f50989..c442016e 100644
--- a/lib/rack/multipart/parser.rb
+++ b/lib/rack/multipart/parser.rb
@@ -99,12 +99,6 @@ module Rack
data = { filename: fn, type: content_type,
name: name, tempfile: body, head: head }
- elsif !filename && content_type && body.is_a?(IO)
- body.rewind
-
- # Generic multipart cases, not coming from a form
- data = { type: content_type,
- name: name, tempfile: body, head: head }
end
yield data