Skip to content

Commit 4925fb3

Browse files
committed
review
1 parent 702cb9c commit 4925fb3

File tree

1 file changed

+3
-2
lines changed
  • packages/open-next/src/overrides/converters

1 file changed

+3
-2
lines changed

packages/open-next/src/overrides/converters/edge.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ const converter: Converter<InternalEvent, InternalResult | MiddlewareResult> = {
3535
),
3636
);
3737

38-
// This is to make libraries (i.e next-auth) that rely on this header to work out of the box in `opennextjs-cloudflare preview`.
39-
if (url.protocol.slice(0, -1) === "http" && url.hostname === "localhost") {
38+
// This is to make libraries (e.g. next-auth) that rely on this header to work out of the box in `opennextjs-cloudflare preview`.
39+
// See https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/lib/utils/env.ts#L95-L96
40+
if (url.protocol.startsWith("http") && url.hostname === "localhost") {
4041
headers["x-forwarded-proto"] = "http";
4142
}
4243

0 commit comments

Comments
 (0)