mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(api): 🐛 Fix Cloudflare R2 incorrectly serving SVG images as XML
This commit is contained in:
parent
de9dca5735
commit
65498e7bd7
|
|
@ -46,6 +46,15 @@ export default (app: Hono) =>
|
|||
},
|
||||
});
|
||||
|
||||
// Check if file extension ends in svg or svg
|
||||
// Cloudflare R2 serves those as application/xml
|
||||
if (
|
||||
media.headers.get("Content-Type") === "application/xml" &&
|
||||
id.endsWith(".svg")
|
||||
) {
|
||||
media.headers.set("Content-Type", "image/svg+xml");
|
||||
}
|
||||
|
||||
const realFilename =
|
||||
media.headers
|
||||
.get("Content-Disposition")
|
||||
|
|
|
|||
Loading…
Reference in a new issue