From f54686df2633ca2ea8ec61747a3b4db09b13b451 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 May 2026 01:57:21 +0000 Subject: [PATCH 1/2] Initial plan From e632c8fc84e5fe9d9fc5a54e366fda09eec27c0b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 May 2026 01:59:33 +0000 Subject: [PATCH 2/2] Allow multiple User-Agent header values --- lib/protocol/http/headers.rb | 2 +- test/protocol/http/headers.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/protocol/http/headers.rb b/lib/protocol/http/headers.rb index 76dcb5a..35160aa 100644 --- a/lib/protocol/http/headers.rb +++ b/lib/protocol/http/headers.rb @@ -345,7 +345,7 @@ def merge(headers) "retry-after" => false, "server" => false, "transfer-encoding" => Header::TransferEncoding, - "user-agent" => false, + "user-agent" => Header::Split, "trailer" => Header::Trailer, # Connection handling: diff --git a/test/protocol/http/headers.rb b/test/protocol/http/headers.rb index e5bb9b2..ed8c44e 100644 --- a/test/protocol/http/headers.rb +++ b/test/protocol/http/headers.rb @@ -281,6 +281,16 @@ expect(headers["content-length"]).to be == "2" end + + it "can merge multiple user-agent headers" do + headers.merge!([ + ["user-agent", "foobar/2000"], + ["user-agent", "foobar/2001"], + ]) + + expect(headers["user-agent"]).to be == ["foobar/2000", "foobar/2001"] + expect(headers["user-agent"].to_s).to be == "foobar/2000,foobar/2001" + end end with "#trailer!" do