mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-01 00:01:03 -04:00
headers: join field values was missing a whitespace, which was breaking option comparison, which was breaking connection reuse
This commit is contained in:
parent
2f94004d8f
commit
7f7a44b1b4
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user