From d91566310ce09fba20f7642f9c1630d86d96a04a Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Wed, 10 Jul 2019 17:36:08 +0300 Subject: [PATCH] Replace control characters with escape characters (#540) --- src/parseBody.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parseBody.js b/src/parseBody.js index 335428b8..537239ed 100644 --- a/src/parseBody.js +++ b/src/parseBody.js @@ -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) {