Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: 🐛 test logging both types of headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ecxyzzy committed Sep 11, 2023
1 parent 7ff81a8 commit 98569de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/api/src/routes/v1/graphql/+endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const graphqlServer = new ApolloServer({
});

export const ANY: APIGatewayProxyHandler = async (event) => {
const { body, headers: eventHeaders, httpMethod: method } = event;
const { body, headers: eventHeaders, multiValueHeaders, httpMethod: method } = event;
logger.info(eventHeaders);
logger.info(multiValueHeaders);

try {
graphqlServer.assertStarted("");
Expand All @@ -43,7 +44,7 @@ export const ANY: APIGatewayProxyHandler = async (event) => {

const req: HTTPGraphQLRequest = {
body,
headers: Object.entries(eventHeaders).reduce(
headers: Object.entries(eventHeaders ?? { "content-encoding": "application/json" }).reduce(
(m, [k, v]) => m.set(k, Array.isArray(v) ? v.join(", ") : v ?? ""),
new HeaderMap(),
),
Expand Down

0 comments on commit 98569de

Please sign in to comment.