Skip to content

Commit

Permalink
Handle /favicon.ico requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mantoni committed Dec 22, 2023
1 parent 9ec1ffe commit c0e3585
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mochify/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ ${modules.map((mod) => `<script type="module" src="${mod}"></script>`).join('')}
`);
return;
}
if (req.url === '/favicon.ico') {
res.writeHead(200, {
'Content-Type': mime.getType('favicon.ico')
});
res.end();
return;
}
const file = path.join(base_path, req.url.substring(1));
try {
await fs_promises.stat(file);
Expand Down

0 comments on commit c0e3585

Please sign in to comment.