diff --git a/lib/handsoap/http/drivers/abstract_driver.rb b/lib/handsoap/http/drivers/abstract_driver.rb index bbc78ec..e387201 100644 --- a/lib/handsoap/http/drivers/abstract_driver.rb +++ b/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