From 937edb7fddd9d4cc2f43a1ebb00c4dd380d802d6 Mon Sep 17 00:00:00 2001 From: Peter Sumskas Date: Fri, 9 Aug 2019 16:36:34 +1000 Subject: [PATCH] split header values on newlines - as created by Rack::Utils --- lib/webmock/http_lib_adapters/net_http.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/webmock/http_lib_adapters/net_http.rb b/lib/webmock/http_lib_adapters/net_http.rb index e7bb4b958..a77a71f3b 100644 --- a/lib/webmock/http_lib_adapters/net_http.rb +++ b/lib/webmock/http_lib_adapters/net_http.rb @@ -158,7 +158,8 @@ def build_net_http_response(webmock_response, &block) response.instance_variable_set(:@body, body) webmock_response.headers.to_a.each do |name, values| - values = [values] unless values.is_a?(Array) + # values = [values] unless values.is_a?(Array) + values = values.split("\n") unless values.is_a?(Array) values.each do |value| response.add_field(name, value) end