mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(nuxt): useRequestHeaders
type should allow for undefined
values (#5748)
This commit is contained in:
parent
aa9950cfb3
commit
490d686fe6
@ -3,8 +3,8 @@ import type { CompatibilityEvent } from 'h3'
|
||||
import { useNuxtApp } from '#app'
|
||||
import { NuxtApp } from '#app/nuxt'
|
||||
|
||||
export function useRequestHeaders<K extends string = string> (include: K[]): Record<K, string>;
|
||||
export function useRequestHeaders (): Readonly<Record<string, string>>;
|
||||
export function useRequestHeaders<K extends string = string> (include: K[]): Record<K, string | undefined>
|
||||
export function useRequestHeaders (): Readonly<Record<string, string | undefined>>
|
||||
export function useRequestHeaders (include?) {
|
||||
if (process.client) { return {} }
|
||||
const headers: Record<string, string | string[]> = useNuxtApp().ssrContext?.event.req.headers ?? {}
|
||||
|
Loading…
Reference in New Issue
Block a user