refactor(surf): take the uploads inline types from attach.IsInlineContentType (quick-261028-rqe)
- the route's private inline list and its helper are gone; the disposition writer asks attach.IsInlineContentType, the same definition attach.Store uses for the disposition it stores - headers are unchanged (TestUploadsResponseHeaders, TestUploadsMount) - surf README and the storage page name the shared function
This commit is contained in:
@@ -111,7 +111,7 @@ The route serves originals and thumbnails and answers 404 for a missing file, an
|
||||
|
||||
- Every response carries `X-Content-Type-Options: nosniff`.
|
||||
- Every response carries `Content-Security-Policy: default-src 'none'; img-src 'self'; media-src 'self'; sandbox`. A file opened as a page runs no script and gets an opaque origin, so it cannot read the application's cookies or storage. The policy does not affect an `<img>` or `<video>` that embeds the file.
|
||||
- A file whose type is not a raster image (`image/jpeg`, `image/png`, `image/gif`, `image/webp` or `image/avif`) is sent with `Content-Disposition: attachment`, so the browser downloads it instead of showing it. That includes HTML, SVG, PDF and plain text.
|
||||
- A file whose type is not a raster image (`image/jpeg`, `image/png`, `image/gif`, `image/webp` or `image/avif`) is sent with `Content-Disposition: attachment`, so the browser downloads it instead of showing it. That includes HTML, SVG, PDF and plain text. The list is `attach.IsInlineContentType`, the same one `attach.Store` uses for the disposition it stores with the file (see the [deploy note](#deploy-note)).
|
||||
|
||||
With `serve` on, `public_path_prefix` must be an absolute URL path such as `/storage/uploads`: a leading slash, no scheme or host, no query, no empty, `.` or `..` segment and no `{` or `}`. Start-up fails with an error naming the key otherwise, for example for the WinterCMS disk path `storage/app/uploads/public` or a CDN URL. With `serve` off the key only builds file URLs, so a CDN origin is fine there.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user