Skip to content

Commit

Permalink
fix(response): fix graphql validation error response header
Browse files Browse the repository at this point in the history
add accept content type instead of text/plain
  • Loading branch information
TomokiMiyauci committed Oct 14, 2022
1 parent 9f350d4 commit f7dbe2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export async function createResponse(

return new Response(JSON.stringify(result), {
status: Status.BadRequest,
headers: {
"content-type": withCharset(accept),
},
});
}

Expand Down
2 changes: 1 addition & 1 deletion response_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ describe("createResponse", () => {
{
status: Status.BadRequest,
headers: {
"content-type": "text/plain;charset=UTF-8",
"content-type": "application/graphql-response+json;charset=UTF-8",
},
},
),
Expand Down

0 comments on commit f7dbe2b

Please sign in to comment.