From e3d35c6b0443eac8b4b6b7486004dde531f72380 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Thu, 24 Nov 2022 12:56:59 -0800 Subject: [PATCH] update docs --- docs/content/1.get-started/3.tips/5.headers.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/content/1.get-started/3.tips/5.headers.md b/docs/content/1.get-started/3.tips/5.headers.md index 81c05a3..46b155e 100644 --- a/docs/content/1.get-started/3.tips/5.headers.md +++ b/docs/content/1.get-started/3.tips/5.headers.md @@ -4,7 +4,7 @@ title: Headers # Headers -We can use the built-in `useRequestHeaders` to access/pass headers to any future internal requests during SSR. +We can use the built-in `useRequestHeaders` to set outgoing request headers: ```ts [plugins/client.ts] export default defineNuxtPlugin(() => { @@ -13,8 +13,12 @@ export default defineNuxtPlugin(() => { const client = createTRPCProxyClient({ links: [ httpBatchLink({ + // headers need to be a function so it gets called dynamically + // every HTTP request headers() { - return headers + return { + ...headers + } } }), ],