Skip to content

Commit

Permalink
Test: add favicon
Browse files Browse the repository at this point in the history
Removes distracting console "error"
  • Loading branch information
dieulot committed Aug 17, 2023
1 parent 591a540 commit 8e08630
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ async function requestListener(req, res) {
headers['Content-Type'] = 'text/javascript'
content += jsContent
}
else if (pathString == 'favicon.ico') {
headers['Content-Type'] = 'image/svg+xml'
const faviconPath = new URL('favicon.svg', import.meta.url)
const favicon = await fs.readFile(faviconPath)
content = favicon
}
else if (!isNaN(page)) {
await sleep(SLEEP_TIME)

Expand Down

0 comments on commit 8e08630

Please sign in to comment.