mirror of
https://github.com/graphql-hive/console
synced 2026-05-23 17:18:23 +00:00
Use application/json when accept is missing (#462)
* Use application/json when accept is missing * Update graphql-handler.ts
This commit is contained in:
parent
dbb5d7ef0a
commit
65546ba49b
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue