New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 598390 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 604829



Sign in to add a comment

[DevTools] JSONView sometimes parses data improperly

Project Member Reported by allada@chromium.org, Mar 28 2016

Issue description

[DevTools] In network view the JSONViewer will sometimes give false positives on the data and sometimes true negatives.

Some examples:

Demo: data:application/json,%7B%22foo%22%3A%3C%22bar%22%7D
JSON: {"foo":<"bar"}
Result: {"foo":"bar"}
Expected: (failure to parse)

Demo: data:application/json,%7B%22foo%22%3A%22b%5Car%22%7D
JSON: {"foo":"b\ar"}
Result: (failure to parse)
Expected: {"foo":"bar"}

Demo: data:application/json,%7Bfoo%3A%20%22bar%22%7D
JSON: {foo: "bar"}
Result: (failure to parse)
Expected: {"foo":"bar"}

Demo: data:application/json,%7B10%3A4%7D
JSON: {10:4}
Result: {"undefined": 4}
Expected: {"10":4}

Demo: data:application/json,%7B%22foo%22%3A010%7D
JSON: {"foo":010}
Result: (failure to parse)
Expected: {"foo":8}
 

Comment 1 by allada@chromium.org, Apr 22 2016

Blocking: 604829
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b3c4942acdf45b1fafbae6955dd544026c2913dd

commit b3c4942acdf45b1fafbae6955dd544026c2913dd
Author: allada <allada@chromium.org>
Date: Sat Apr 23 00:15:37 2016

[DevTools] JSONView parsing smarter

[Copy of  issue 1838873002 due to bug with bad patch.]

JSONView should now be a little more smart in the way it parses data.
Users may send many different kinds of JSON and it should still display
it to the users. If the JSON is much to far gone to be considered JSON
the parser will exit (for example if the user sends things like:
{a:5*5} it will not parse it. ie: no arithmics... static content only)

BUG= 598390 
R=lushnikov

Review URL: https://codereview.chromium.org/1912973002

Cr-Commit-Position: refs/heads/master@{#389321}

[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/LayoutTests/http/tests/inspector/network/json-preview.html
[delete] https://crrev.com/79080da0203790b2e12ab36ab50f8a374aea8455/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-preview-json-expected.txt
[delete] https://crrev.com/79080da0203790b2e12ab36ab50f8a374aea8455/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-preview-json.html
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/LayoutTests/inspector/network/network-json-parser-expected.txt
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/LayoutTests/inspector/network/network-json-parser.html
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/devtools.gypi
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/es_tree/ESTreeWalker.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/externs.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js
[add] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/formatter_worker/RelaxedJSONParser.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/formatter_worker/module.json
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/network/JSONView.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js

Comment 3 by allada@chromium.org, Apr 23 2016

Status: Fixed (was: Started)
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 25 2016

Labels: merge-merged-2716
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b3c4942acdf45b1fafbae6955dd544026c2913dd

commit b3c4942acdf45b1fafbae6955dd544026c2913dd
Author: allada <allada@chromium.org>
Date: Sat Apr 23 00:15:37 2016

[DevTools] JSONView parsing smarter

[Copy of  issue 1838873002 due to bug with bad patch.]

JSONView should now be a little more smart in the way it parses data.
Users may send many different kinds of JSON and it should still display
it to the users. If the JSON is much to far gone to be considered JSON
the parser will exit (for example if the user sends things like:
{a:5*5} it will not parse it. ie: no arithmics... static content only)

BUG= 598390 
R=lushnikov

Review URL: https://codereview.chromium.org/1912973002

Cr-Commit-Position: refs/heads/master@{#389321}

[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/LayoutTests/http/tests/inspector/network/json-preview.html
[delete] https://crrev.com/79080da0203790b2e12ab36ab50f8a374aea8455/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-preview-json-expected.txt
[delete] https://crrev.com/79080da0203790b2e12ab36ab50f8a374aea8455/third_party/WebKit/LayoutTests/http/tests/inspector/network/network-preview-json.html
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/LayoutTests/inspector/network/network-json-parser-expected.txt
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/LayoutTests/inspector/network/network-json-parser.html
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/devtools.gypi
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/es_tree/ESTreeWalker.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/externs.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js
[add] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/formatter_worker/RelaxedJSONParser.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/formatter_worker/module.json
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/network/JSONView.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
[modify] https://crrev.com/b3c4942acdf45b1fafbae6955dd544026c2913dd/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js

Sign in to add a comment