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

Commit

Permalink
Replace control characters with escape characters (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored Jul 10, 2019
1 parent e840626 commit 0473097
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 0473097

Please sign in to comment.