Skip to content

Commit

Permalink
Fix forwarding of repeated headers
Browse files Browse the repository at this point in the history
Repeated headers may not always be combined into a single header separated with a comma (eg: cookies) but they can always be repeated for the different values.

fixes ysbaddaden#32
  • Loading branch information
urkle authored and ysbaddaden committed Sep 13, 2016
1 parent f51f9e0 commit 0accf01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/prax/parser/header.cr
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ module Prax
end

def to_s
"#{name}: #{values.join(", ")}"
values.map {|value|
"#{name}: #{value}"
}.join("\r\n")
end

def to_i
Expand Down
2 changes: 1 addition & 1 deletion test/proxy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_supports_xip_io

def test_returns_multiple_set_cookie_headers
response = Net::HTTP.get_response(URI("http://cookies.dev:20557/"))
assert_equal ["first=123, second=456"], response.get_fields("Set-Cookie")
assert_equal ["first=123", "second=456"], response.get_fields("Set-Cookie")
end

def test_supports_bundler_with_special_gems
Expand Down

0 comments on commit 0accf01

Please sign in to comment.