Skip to content

Commit 11df72b

Browse files
committed
fix: use favicon.ico instead of /static/favicon-32x32.png
1 parent d0359b1 commit 11df72b

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

frontend/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/png" href="/static/favicon-32x32.png" />
5+
<link rel="icon" type="image/png" href="favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>%INDEX_PAGE_TITLE%</title>
88
</head>

src/handlers/handleRead.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async function handleStaticPages(request: Request, env: Env, _: ExecutionContext
5252
} else if (path.lastIndexOf("/") === 0 && path.indexOf(":") > 0) {
5353
path = "/index.html" // handle admin URL
5454
}
55-
if (path.startsWith("/assets/") || path.startsWith("/static/") || path === "/index.html") {
55+
if (path.startsWith("/assets/") || path === "/favicon.ico" || path === "/index.html") {
5656
if (path === "/index.html") {
5757
const authResponse = verifyAuth(request, env)
5858
if (authResponse !== null) {

test/basicAuth.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from "vitest"
2-
import { areBlobsEqual, BASE_URL, createFormData, genRandomBlob, staticPages, workerFetch } from "./testUtils.js"
2+
import { areBlobsEqual, BASE_URL, createFormData, genRandomBlob, workerFetch } from "./testUtils.js"
33
import { encodeBasicAuth, decodeBasicAuth } from "../src/auth.js"
44
import { createExecutionContext, env } from "cloudflare:test"
55
import { PasteResponse } from "../src/shared"
@@ -32,7 +32,7 @@ test("basic auth", async () => {
3232
env.BASIC_AUTH = users
3333

3434
// access index page
35-
for (const page of staticPages) {
35+
for (const page of ["", "index", "index.html"]) {
3636
expect((await workerFetch(ctx, `${BASE_URL}/${page}`)).status).toStrictEqual(401)
3737
}
3838
expect(

test/testUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { PasteResponse } from "../src/shared"
99
export const BASE_URL: string = env.DEPLOY_URL
1010
export const RAND_NAME_REGEX = /^[ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678]+$/
1111

12-
export const staticPages = ["", "index.html", "index", "tos", "tos.html", "api", "api.html"]
12+
export const staticPages = ["", "index.html", "index", "tos", "tos.html", "api", "api.html", "favicon.ico"]
1313

1414
type FormDataBuild = {
1515
[key: string]: string | Blob | { content: Blob; filename: string }

worker-configuration.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* eslint-disable */
2-
// Generated by Wrangler by running `wrangler types --strict-vars false` (hash: 6b22c42e567b3c204913f826b6198cca)
2+
// Generated by Wrangler by running `wrangler types --strict-vars false` (hash: 10ab9202aff10f1034182c3c5aea97a8)
33
// Runtime types generated with workerd@1.20250424.0 2025-04-24
44
declare namespace Cloudflare {
55
interface Env {
66
PB: KVNamespace;
77
DEPLOY_URL: string;
88
REPO: string;
9-
TOS_MAINTAINER: string;
109
INDEX_PAGE_TITLE: string;
10+
TOS_MAINTAINER: string;
1111
TOS_MAIL: string;
1212
CACHE_STATIC_PAGE_AGE: number;
1313
CACHE_PASTE_AGE: number;

0 commit comments

Comments
 (0)