mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What? I submitted PR #64499 , it got merged, but it contains a mistake. I'm terribly sorry about this! By removing the traceparent from the cachekey, we mistakenly removed the header from the original object. Causing the actual request to be executed without the traceparent header. ### Why? Creating a cachekey should not alter the original object. ### How? Flip the arguments for Object.assign --------- Co-authored-by: Jeffrey <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
34 lines
800 B
TypeScript
34 lines
800 B
TypeScript
export default async function Page() {
|
|
const data1 = await fetch(
|
|
'https://next-data-api-endpoint.vercel.app/api/random',
|
|
{
|
|
headers: { traceparent: 'A' },
|
|
next: { revalidate: 50 },
|
|
}
|
|
).then((res) => res.text())
|
|
|
|
const data2 = await fetch(
|
|
'https://next-data-api-endpoint.vercel.app/api/random',
|
|
{
|
|
headers: { traceparent: 'B' },
|
|
next: { revalidate: 50 },
|
|
}
|
|
).then((res) => res.text())
|
|
|
|
const echoedHeaders = await fetch(
|
|
'https://next-data-api-endpoint.vercel.app/api/echo-headers',
|
|
{
|
|
headers: { traceparent: 'C' },
|
|
next: { revalidate: 50 },
|
|
}
|
|
).then((res) => res.text())
|
|
|
|
return (
|
|
<>
|
|
<p id="data1">{data1}</p>
|
|
<p id="data2">{data2}</p>
|
|
<p id="echoedHeaders">{echoedHeaders}</p>
|
|
</>
|
|
)
|
|
}
|