headers: join field values was missing a whitespace, which was breaking option comparison, which was breaking connection reuse

This commit is contained in:
HoneyryderChuck 2020-04-23 11:12:34 +01:00
parent 2f94004d8f
commit 7f7a44b1b4
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ module HTTPX
#
def [](field)
a = @headers[downcased(field)] || return
a.join(",")
a.join(", ")
end
# sets +value+ (if not nil) as single value for the +field+ header.

View File

@ -25,7 +25,7 @@ class HeadersTest < Minitest::Test
def test_headers_add
h1 = Headers.new("accept" => "text/html")
h1.add("accept", "application/xhtml+xml")
assert h1["accept"] == "text/html,application/xhtml+xml", "unexpected header value"
assert h1["accept"] == "text/html, application/xhtml+xml", "unexpected header value"
assert h1.get("accept") == %w[text/html application/xhtml+xml], "unexpected header value"
end