Skip to content

Commit

Permalink
fix: passing body for graphql requests generated from aws-appsync-sim…
Browse files Browse the repository at this point in the history
…ulator
  • Loading branch information
sc0ttdav3y committed Oct 24, 2024
1 parent b19b0ea commit 0298c1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apiGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function httpRequestToEvent(request: Request): APIGatewayProxyEventV2 {
}
);

const bodyString = request.method === 'GET' ? '' : request.body.toString('utf8');
const bodyString = request.body.toString('utf8');
const shouldSendBase64 = request.method === 'GET' ? false : bodyString.includes('Content-Disposition: form-data');

const cookies = request.headers.cookie ? request.headers.cookie.split('; ') : [];
Expand All @@ -61,7 +61,7 @@ export function httpRequestToEvent(request: Request): APIGatewayProxyEventV2 {
method: request.method,
path: request.path,
protocol: request.protocol,
sourceIp: request.ip,
sourceIp: String(request.ip),
userAgent: request.header('User-Agent') ?? '',
},
accountId: '123456789012',
Expand Down

0 comments on commit 0298c1f

Please sign in to comment.