Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Always allow favicons in dev

Blue Mouse51d7c6c44fb4
diff --git a/web/app/routes/api.favicon.ts b/web/app/routes/api.favicon.ts
index c1d87952a..039c42462 100644
--- a/web/app/routes/api.favicon.ts
+++ b/web/app/routes/api.favicon.ts
@@ -1,8 +1,8 @@
import { type LoaderFunctionArgs } from 'react-router'
-import { isSelfhosted } from '~/lib/constants'
+import { isSelfhosted, isDevelopment } from '~/lib/constants'
-const ALLOWED_ORIGIN_RE = /^https?:\/\/([a-z0-9-]+\.)*swetrix\.com$/i
+const ALLOWED_ORIGIN_RE = /^https?:\/\/([a-z0-9-]+\.)*swetrix\.com(\/|$)/i
const CACHE_TTL = 60 * 60 * 24 * 7 // 7 days
const STALE_TTL = 60 * 60 * 24 * 30 // 30 days
@@ -10,7 +10,7 @@ const STALE_TTL = 60 * 60 * 24 * 30 // 30 days
const FALLBACK_ICO = '/assets/icons/chain.svg'
function isOriginAllowed(request: Request): boolean {
- if (isSelfhosted) return true
+ if (isSelfhosted || isDevelopment) return true
const origin =
request.headers.get('Origin') || request.headers.get('Referer') || ''