mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-08 00:02:42 -04:00
multipart decoding: fail if no boundary found in header
This commit is contained in:
parent
e1ee8c69dc
commit
802c47a037
@ -49,7 +49,9 @@ module HTTPX::Plugins
|
|||||||
def initialize(response)
|
def initialize(response)
|
||||||
@boundary = begin
|
@boundary = begin
|
||||||
m = response.headers["content-type"].to_s[BOUNDARY_RE, 1]
|
m = response.headers["content-type"].to_s[BOUNDARY_RE, 1]
|
||||||
m && m.strip
|
raise Error, "no boundary declared in content-type header" unless m
|
||||||
|
|
||||||
|
m.strip
|
||||||
end
|
end
|
||||||
@buffer = "".b
|
@buffer = "".b
|
||||||
@parts = {}
|
@parts = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user