Allow control characters in strings when CORB sniffs for JSON.
RFC7159 requires the control characters (U+0000 through U+001F) to be escaped, but in practice these characters might still appear in JSON resources on the web. To ensure that CORB protects such resources, this CL modifies CrossOriginReadBlocking::SniffForJSON so that it ignores control characters. This CL should be safe wrt backcompatibility, because `kYes` answer from sniffing would still indicate that the input is not valid Javascript. For example, the following is not valid Javascript, even if the string contains a control character: { "... <unescaped control character here> ..." : ... } Fixed: 1148397 Change-Id: I368a6971a911618344b4886f7c7ccc2f95d6187d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2596879 Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by:Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#840402}
Showing
Please register or sign in to comment