SVGs now display correctly
This commit is contained in:
parent
6c205a0ad3
commit
9a443a6f36
1 changed files with 9 additions and 1 deletions
|
@ -10,5 +10,13 @@ export async function GET({ url, cookies, params }) {
|
|||
|
||||
var res = await readFile(`${process.cwd()}/db/post-${imgName}`);
|
||||
|
||||
return new Response(res);
|
||||
var response = new Response(res);
|
||||
var extension = imgName.split('.').pop();
|
||||
|
||||
if (extension == 'svg') {
|
||||
response = new Response(res, {'headers': {
|
||||
'Content-Type': 'image/svg+xml'
|
||||
}});
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue