mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-05 08:06:19 +00:00
fix: ensure X-App-Source header survives per-request header overrides
Add onRequest hook to Nova $fetch client so X-App-Source: nova is always injected even when individual calls pass their own headers object (which shallow-replaces the createFetch defaults).
This commit is contained in:
parent
f8a2b0046e
commit
6e077e1a2f
1 changed files with 5 additions and 0 deletions
|
|
@ -254,6 +254,11 @@ export const $fetch = createFetch({
|
|||
baseURL: `${process.env.NEXT_PUBLIC_BACKEND_URL ?? "https://api.supermemory.ai"}/v3`,
|
||||
credentials: "include",
|
||||
headers: { "X-App-Source": "nova" },
|
||||
onRequest: (context: { headers: Headers }) => {
|
||||
if (!context.headers.has("X-App-Source")) {
|
||||
context.headers.set("X-App-Source", "nova")
|
||||
}
|
||||
},
|
||||
retry: {
|
||||
attempts: 3,
|
||||
delay: 100,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue