multipart decoding: fail if no boundary found in header

This commit is contained in:
HoneyryderChuck 2021-08-10 10:20:06 +01:00
parent e1ee8c69dc
commit 802c47a037

View File

@ -49,7 +49,9 @@ module HTTPX::Plugins
def initialize(response)
@boundary = begin
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
@buffer = "".b
@parts = {}