File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
packages/open-next/src/overrides/converters Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @opennextjs/aws " : patch
3+ ---
4+
5+ fix: remove leading forward slashes from url in node converter
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import type { Converter } from "types/overrides";
66import { extractHostFromHeaders , getQueryFromSearchParams } from "./utils.js" ;
77
88const converter : Converter = {
9- convertFrom : async ( req : IncomingMessage ) => {
9+ convertFrom : async ( req : IncomingMessage & { protocol ?: string } ) => {
1010 const body = await new Promise < Buffer > ( ( resolve ) => {
1111 const chunks : Uint8Array [ ] = [ ] ;
1212 req . on ( "data" , ( chunk ) => {
@@ -25,7 +25,10 @@ const converter: Converter = {
2525 ] )
2626 . filter ( ( [ key ] ) => key ) ,
2727 ) ;
28- const url = new URL ( req . url ! , `http://${ extractHostFromHeaders ( headers ) } ` ) ;
28+ // https://nodejs.org/api/http.html#messageurl
29+ const url = new URL (
30+ `${ req . protocol ? req . protocol : "http" } ://${ extractHostFromHeaders ( headers ) } ${ req . url } ` ,
31+ ) ;
2932 const query = getQueryFromSearchParams ( url . searchParams ) ;
3033 return {
3134 type : "core" ,
You can’t perform that action at this time.
0 commit comments