Skip to content

Commit

Permalink
feat: strip traceparent header from cachekey
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey committed Apr 15, 2024
1 parent 33e8334 commit ab67421
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/next/src/server/lib/incremental-cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,19 @@ export class IncrementalCache implements IncrementalCacheType {
}
}

const headers =
typeof (init.headers || {}).keys === 'function'
? Object.fromEntries(init.headers as Headers)
: Object.assign(init.headers || {}, {})

if ('traceparent' in headers) delete headers['traceparent']

const cacheString = JSON.stringify([
MAIN_KEY_PREFIX,
this.fetchCacheKeyPrefix || '',
url,
init.method,
typeof (init.headers || {}).keys === 'function'
? Object.fromEntries(init.headers as Headers)
: init.headers,
headers,
init.mode,
init.redirect,
init.credentials,
Expand Down

0 comments on commit ab67421

Please sign in to comment.