Skip to content

Commit

Permalink
Replace control characters with escape characters (graphql#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored and jliu670 committed Aug 14, 2020
1 parent e793bb2 commit d915663
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/parseBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ export async function parseBody(
* RegExp to match an Object-opening brace "{" as the first non-space
* in a string. Allowed whitespace is defined in RFC 7159:
*
* x20 Space
* x09 Horizontal tab
* x0A Line feed or New line
* x0D Carriage return
* ' ' Space
* '\t' Horizontal tab
* '\n' Line feed or New line
* '\r' Carriage return
*/
const jsonObjRegex = /^[\x20\x09\x0a\x0d]*\{/;
const jsonObjRegex = /^[ \t\n\r]*\{/;

// Read and parse a request body.
async function readBody(req, typeInfo) {
Expand Down

0 comments on commit d915663

Please sign in to comment.