File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
packages/open-next/src/overrides Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,6 @@ const converter: Converter = {
31
31
) ;
32
32
const query = getQueryFromSearchParams ( url . searchParams ) ;
33
33
34
- if ( req . protocol === "http" && url . hostname === "localhost" ) {
35
- // This is used internally by Next.js during redirects in server actions. We need to set it to the origin of the request.
36
- process . env . __NEXT_PRIVATE_ORIGIN = url . origin ;
37
- // This is to make `next-auth` and other libraries that rely on this header to work locally out of the box.
38
- headers [ "x-forwarded-proto" ] = req . protocol ;
39
- }
40
-
41
34
return {
42
35
type : "core" ,
43
36
method : req . method ?? "GET" ,
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ const wrapper: WrapperHandler = async (handler, converter) => {
34
34
} ) ;
35
35
36
36
app . all ( "*paths" , async ( req , res ) => {
37
+ if ( req . protocol === "http" && req . hostname === "localhost" ) {
38
+ // This is used internally by Next.js during redirects in server actions. We need to set it to the origin of the request.
39
+ process . env . __NEXT_PRIVATE_ORIGIN = `${ req . protocol } ://${ req . hostname } ` ;
40
+ // This is to make `next-auth` and other libraries that rely on this header to work locally out of the box.
41
+ req . headers [ "x-forwarded-proto" ] = req . protocol ;
42
+ }
37
43
const internalEvent = await converter . convertFrom ( req ) ;
38
44
const streamCreator : StreamCreator = {
39
45
writeHeaders : ( prelude ) => {
You can’t perform that action at this time.
0 commit comments