File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export function httpRequestToEvent(request: Request): APIGatewayProxyEventV2 {
3434 }
3535 ) ;
3636
37- const bodyString = request . method === 'GET' ? '' : request . body . toString ( 'utf8' ) ;
37+ const bodyString = Buffer . isBuffer ( request . body ) ? request . body . toString ( 'utf8' ) : '' ;
3838 const shouldSendBase64 = request . method === 'GET' ? false : bodyString . includes ( 'Content-Disposition: form-data' ) ;
3939
4040 const cookies = request . headers . cookie ? request . headers . cookie . split ( '; ' ) : [ ] ;
@@ -61,7 +61,7 @@ export function httpRequestToEvent(request: Request): APIGatewayProxyEventV2 {
6161 method : request . method ,
6262 path : request . path ,
6363 protocol : request . protocol ,
64- sourceIp : request . ip ,
64+ sourceIp : String ( request . ip ) ,
6565 userAgent : request . header ( 'User-Agent' ) ?? '' ,
6666 } ,
6767 accountId : '123456789012' ,
You can’t perform that action at this time.
0 commit comments