Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 8229498

Browse files
danielreardenIvanGoncharov
authored andcommitted
Update graphqlMiddleware and parseBody
1 parent 8436480 commit 8229498

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export function graphqlHTTP(options: Options): Middleware {
255255

256256
// Get GraphQL params from the request and POST body data.
257257
const { query, variables, operationName } = params;
258-
showGraphiQL = canDisplayGraphiQL(request, params) && graphiql;
258+
showGraphiQL = canDisplayGraphiQL(request, params) && graphiql !== false;
259259
if (typeof graphiql !== 'boolean') {
260260
graphiqlOptions = graphiql;
261261
}

src/parseBody.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ async function readBody(
8282
// TODO: Import the appropriate TS type and use it here instead
8383
typeInfo: {| type: string, parameters: { [param: string]: string, ... } |},
8484
): Promise<string> {
85-
const charset = (typeInfo.parameters.charset ?? 'utf-8').toLowerCase();
85+
// flowlint-next-line unnecessary-optional-chain:off
86+
const charset = typeInfo.parameters.charset?.toLowerCase() ?? 'utf-8';
8687

8788
// Assert charset encoding per JSON RFC 7159 sec 8.1
8889
if (charset.slice(0, 4) !== 'utf-') {

0 commit comments

Comments
 (0)