Skip to content

Commit

Permalink
Fix: Vary HTTP header (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored Apr 8, 2023
1 parent 1c53221 commit 91c05a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/propshaft/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def call(env)
{
"content-length" => compiled_content.length.to_s,
"content-type" => asset.content_type.to_s,
"accept-encoding" => "vary",
"vary" => "Accept-Encoding",
"etag" => asset.digest,
"cache-control" => "public, max-age=31536000, immutable"
},
Expand Down
2 changes: 1 addition & 1 deletion test/propshaft/server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Propshaft::ServerTest < ActiveSupport::TestCase
assert_equal 200, last_response.status
assert_equal "94", last_response.headers['content-length']
assert_equal "text/css", last_response.headers['content-type']
assert_equal "vary", last_response.headers['accept-encoding']
assert_equal "Accept-Encoding", last_response.headers['vary']
assert_equal asset.digest, last_response.headers['etag']
assert_equal "public, max-age=31536000, immutable", last_response.headers['cache-control']
assert_equal ".hero { background: url(\"/foobar/source/file-3e6a129785ee3caf8eff23db339997e85334bfa9.jpg\") }\n",
Expand Down

0 comments on commit 91c05a4

Please sign in to comment.