From 2758d51dbfc1544010b80543a47917b78276f142 Mon Sep 17 00:00:00 2001 From: Guilherme Carreiro Date: Wed, 12 Jan 2022 17:57:38 +0100 Subject: [PATCH] Move logic to 'proxy.rb' and DRY headers logic --- lib/shopify_cli/theme/dev_server/proxy.rb | 1 + test/shopify-cli/theme/dev_server/proxy_test.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/shopify_cli/theme/dev_server/proxy.rb b/lib/shopify_cli/theme/dev_server/proxy.rb index 0aeae1aac2..223e6455b0 100644 --- a/lib/shopify_cli/theme/dev_server/proxy.rb +++ b/lib/shopify_cli/theme/dev_server/proxy.rb @@ -18,6 +18,7 @@ module DevServer "trailer", "transfer-encoding", "upgrade", + "content-security-policy", ] class Proxy diff --git a/test/shopify-cli/theme/dev_server/proxy_test.rb b/test/shopify-cli/theme/dev_server/proxy_test.rb index 6fe6cd056f..91033d213e 100644 --- a/test/shopify-cli/theme/dev_server/proxy_test.rb +++ b/test/shopify-cli/theme/dev_server/proxy_test.rb @@ -176,11 +176,13 @@ def test_hop_to_hop_headers_are_removed_from_proxied_response "Trailer" => 1, "Transfer-Encoding" => 1, "Upgrade" => 1, + "content-security-policy" => 1, }) stub_session_id_request response = request.get("/") + assert(response.headers.size.zero?) HOP_BY_HOP_HEADERS.each do |header| assert(response.headers[header].nil?) end