Skip to content

Commit 2a3ee86

Browse files
authored
await headers() (#1019)
1 parent a6904a4 commit 2a3ee86

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/tall-dancers-cross.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/cloudflare": patch
3+
---
4+
5+
await `headers()`

examples/middleware/app/middleware/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { headers } from "next/headers";
22

3-
export default function MiddlewarePage() {
4-
const cloudflareContextHeader = headers().get("x-cloudflare-context");
3+
export default async function MiddlewarePage() {
4+
const cloudflareContextHeader = (await headers()).get("x-cloudflare-context");
55

66
return (
77
<>

examples/playground15/app/api/buildid/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export async function GET() {
55
const nextConfig = process.env.__NEXT_PRIVATE_STANDALONE_CONFIG
66
? JSON.parse(process.env.__NEXT_PRIVATE_STANDALONE_CONFIG)
77
: undefined;
8-
return Response.json({ nextConfig, headers: headers() });
8+
return Response.json({ nextConfig, headers: await headers() });
99
}

0 commit comments

Comments
 (0)