Skip to content

Commit

Permalink
Add quotes to etags (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
zarqman authored Nov 28, 2024
1 parent b6dab44 commit 1cfc401
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 @@ -18,7 +18,7 @@ def call(env)
Rack::CONTENT_LENGTH => compiled_content.length.to_s,
Rack::CONTENT_TYPE => asset.content_type.to_s,
VARY => "Accept-Encoding",
Rack::ETAG => asset.digest,
Rack::ETAG => "\"#{asset.digest}\"",
Rack::CACHE_CONTROL => "public, max-age=31536000, immutable"
},
[ compiled_content ]
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 @@ -23,7 +23,7 @@ class Propshaft::ServerTest < ActiveSupport::TestCase
assert_equal "62", last_response.headers['content-length']
assert_equal "text/css", last_response.headers['content-type']
assert_equal "Accept-Encoding", last_response.headers['vary']
assert_equal asset.digest, last_response.headers['etag']
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-3e6a1297.jpg\") }\n",
last_response.body
Expand Down

0 comments on commit 1cfc401

Please sign in to comment.