Skip to content
Browse files

Update lib/handsoap/http/drivers/abstract_driver.rb

  • Loading branch information...
1 parent 48d2ef5 commit 584fa87935eb47fe3484c10d7409dfeed8e9f6a0 @intouchmvc intouchmvc committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/handsoap/http/drivers/abstract_driver.rb
View
6 lib/handsoap/http/drivers/abstract_driver.rb
@@ -64,8 +64,14 @@ def parse_multipart(boundary, content_io, content_length = nil)
boundary_size = boundary.size + "\r\n".size
content_length -= boundary_size
status = content_io.read(boundary_size)
+
if nil == status
raise EOFError, "no content body"
+ elsif "\r\n" + boundary == status
+ extra = content_io.read("\r\n".size)
+ unless extra == "\r\n"
+ raise EOFError, "parse error while reading boundary"
+ end
elsif boundary + "\r\n" != status
raise EOFError, "bad content body"
end

0 comments on commit 584fa87

Please sign in to comment.
Something went wrong with that request. Please try again.