fix: deleted image wrongfully caching

This commit is contained in:
fsylvain committed 2026-10-01 05:27:25 +02:00
1 parent b3793d5dbb
commit ff0854f331
19 files changed
+201 -87

No files matched your search

+8 -6
View File
@@ -23,9 +23,11 @@ Feature: Serving uploaded images as static files
"application/octet-stream"
And every response from this handler, success or 404, sets
"X-Content-Type-Options: nosniff"
And every successful response sets a long-lived, public Cache-Control
header, e.g. "public, max-age=31536000, immutable", because a stored
filename is a UUID and its bytes never change
And every successful response sets the Cache-Control header
"public, no-cache", so a browser may store the file but must revalidate
it before reusing it; a stored filename is a UUID and its bytes never
change, but the file can be deleted from the media library, and a
long-lived cache would keep showing it
And an "image/svg+xml" response additionally sets
"Content-Security-Policy: default-src 'none'; style-src
'unsafe-inline'; sandbox", so a script embedded in an uploaded SVG
@@ -42,7 +44,7 @@ Feature: Serving uploaded images as static files
cookie
Then the response status is 200
And the response Content-Type is <content_type>
And the response Cache-Control is "public, max-age=31536000, immutable"
And the response Cache-Control is "public, no-cache"
And the response X-Content-Type-Options is "nosniff"
And the response has no Content-Security-Policy header
And the response body is that file's exact content
@@ -61,7 +63,7 @@ Feature: Serving uploaded images as static files
with no jwt cookie
Then the response status is 200
And the response Content-Type is "image/svg+xml"
And the response Cache-Control is "public, max-age=31536000, immutable"
And the response Cache-Control is "public, no-cache"
And the response X-Content-Type-Options is "nosniff"
And the response Content-Security-Policy is
"default-src 'none'; style-src 'unsafe-inline'; sandbox"
@@ -128,7 +130,7 @@ Feature: Serving uploaded images as static files
with no jwt cookie
Then the response status is 200
And the response Content-Type is "image/webp"
And the response Cache-Control is "public, max-age=31536000, immutable"
And the response Cache-Control is "public, no-cache"
And the response X-Content-Type-Options is "nosniff"
And the response body is empty