Skip to content

Commit

Permalink
feat: add favicon redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
SharzyL committed Mar 11, 2024
1 parent 96c411e commit 1073dd1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ async function handleGet(request, env, ctx) {
const url = new URL(request.url)
const { role, short, ext, passwd, filename } = parsePath(url.pathname)

if (url.pathname == '/favicon.ico' && env.FAVICON) {
return Response.redirect(env.FAVICON)
}

const staticPageContent = getStaticPage(url.pathname, env)
if (staticPageContent) {
// access to all static pages requires auth
Expand Down

0 comments on commit 1073dd1

Please sign in to comment.