mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
* feat: frontend docker image * build: tweak gc, disable prerendering * feat: pass along UA * fix: fallback to process.env * build: remove this pr branch test * fix: don't pin docker image ver
10 lines
369 B
TypeScript
10 lines
369 B
TypeScript
import { tryUseNuxtApp } from '#imports'
|
|
|
|
// Nuxt's `useRequestHeaders` throws outside of a setup context, and `useBaseFetch` is
|
|
// called from plenty of places that no longer have one.
|
|
export function useVisitorUserAgent(): string | undefined {
|
|
if (!import.meta.server) return undefined
|
|
|
|
return tryUseNuxtApp()?.ssrContext?.event?.node?.req?.headers['user-agent']
|
|
}
|