Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Move logic to 'proxy.rb' and DRY headers logic
Browse files Browse the repository at this point in the history
  • Loading branch information
karreiro committed Jan 12, 2022
1 parent 4ff17ab commit 2758d51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/shopify_cli/theme/dev_server/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module DevServer
"trailer",
"transfer-encoding",
"upgrade",
"content-security-policy",
]

class Proxy
Expand Down
2 changes: 2 additions & 0 deletions test/shopify-cli/theme/dev_server/proxy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2758d51

Please sign in to comment.