File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ function getMiddlewareRequestHeaders(response: any) {
6767 const headers : Record < string , string > = { } ;
6868 ( response . headers . get ( "x-middleware-override-headers" ) || "" )
6969 . split ( "," )
70+ . filter ( Boolean )
7071 . forEach ( ( key : string ) => {
7172 headers [ key ] = response . headers . get ( `x-middleware-request-${ key } ` )
7273 } ) ;
Original file line number Diff line number Diff line change @@ -50,6 +50,11 @@ const server = slsHttp(
5050 {
5151 binary : true ,
5252 provider : "aws" ,
53+ request : ( request : any ) => {
54+ // nextjs doesn't parse body if the property exists
55+ // https://github.com/dougmoscrop/serverless-http/issues/227
56+ delete request . body ;
57+ } ,
5358 } ,
5459) ;
5560
@@ -100,4 +105,4 @@ function loadHtmlPages() {
100105 return Object . entries ( JSON . parse ( json ) )
101106 . filter ( ( [ _ , value ] ) => ( value as string ) . endsWith ( ".html" ) )
102107 . map ( ( [ key ] ) => key ) ;
103- }
108+ }
You can’t perform that action at this time.
0 commit comments