mirror of
https://github.com/w0rng/amnezia-wg-easy.git
synced 2025-04-25 21:00:21 +03:00
fix: add Content-Type header for static files (#933)
This commit is contained in:
commit
f134a3671a
1 changed files with 6 additions and 0 deletions
|
@ -225,6 +225,12 @@ module.exports = class Server {
|
|||
return;
|
||||
}
|
||||
|
||||
if (id.endsWith('.html')) setHeader(event, 'Content-Type', 'text/html');
|
||||
if (id.endsWith('.js')) setHeader(event, 'Content-Type', 'application/javascript');
|
||||
if (id.endsWith('.json')) setHeader(event, 'Content-Type', 'application/json');
|
||||
if (id.endsWith('.css')) setHeader(event, 'Content-Type', 'text/css');
|
||||
if (id.endsWith('.png')) setHeader(event, 'Content-Type', 'image/png');
|
||||
|
||||
return {
|
||||
size: stats.size,
|
||||
mtime: stats.mtimeMs,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue