diff --git a/CHANGELOG.md b/CHANGELOG.md index cff95faf2..bc8dcd9a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Validated that `SOURCEBOT_ENCRYPTION_KEY` is exactly 32 characters at startup, failing fast with an actionable message instead of a runtime encryption error. [#1305](https://github.com/sourcebot-dev/sourcebot/pull/1305) +- Fixed the web UI crashing when anonymous access is enabled and a request omits the `User-Agent` header (e.g. proxy or health-check probes). [#1309](https://github.com/sourcebot-dev/sourcebot/pull/1309) ## [5.0.2] - 2026-06-11 diff --git a/packages/web/src/app/(app)/layout.tsx b/packages/web/src/app/(app)/layout.tsx index 15997cfd5..ec355a56d 100644 --- a/packages/web/src/app/(app)/layout.tsx +++ b/packages/web/src/app/(app)/layout.tsx @@ -148,7 +148,7 @@ export default async function Layout(props: LayoutProps) { const headersList = await headers(); const cookieStore = await cookies() const userAgent = headersList.get('user-agent'); - const { isMobile } = getSelectorsByUserAgent(userAgent ?? ''); + const { isMobile } = userAgent ? getSelectorsByUserAgent(userAgent) : { isMobile: false }; if (isMobile && !cookieStore.has(MOBILE_UNSUPPORTED_SPLASH_SCREEN_DISMISSED_COOKIE_NAME)) { return (