Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

patch for multi part parsing for use with japser server #27

Merged
merged 1 commit into from
May 21, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/handsoap/http/drivers/abstract_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down