Use application/json when accept is missing (#462)

* Use application/json when accept is missing

* Update graphql-handler.ts
This commit is contained in:
Kamil Kisiela 2022-10-06 16:02:45 +02:00 committed by GitHub
parent dbb5d7ef0a
commit 65546ba49b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -238,6 +238,12 @@ export const graphqlHandler = (options: GraphQLHandlerOptions): RouteHandlerMeth
if (!reply.hasHeader('x-request-id')) {
reply.header('x-request-id', requestId || '');
}
const accept = req.headers.accept;
if (!accept) {
reply.header('content-type', 'application/json');
}
reply.status(response.status);