Created
August 20, 2015 17:48
-
-
Save jkrems/5f08ab53c05d96356a1e to your computer and use it in GitHub Desktop.
Devtools doesn't format JSON responses when they have trailing whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Source/devtools/front_end/network/RequestJSONView.js b/Source/devtools/front_end/network/RequestJSONView.js | |
index f88c212..a5b3eed 100644 | |
--- a/Source/devtools/front_end/network/RequestJSONView.js | |
+++ b/Source/devtools/front_end/network/RequestJSONView.js | |
@@ -152,7 +152,7 @@ WebInspector.RequestJSONView.parseJSON = function(text) | |
text = text.substring(inner.start, inner.end + 1); | |
// Only process valid JSONP. | |
- if (suffix.length && !(suffix.trim().startsWith(")") && prefix.trim().endsWith("("))) | |
+ if (suffix.trim().length && !(suffix.trim().startsWith(")") && prefix.trim().endsWith("("))) | |
return null; | |
try { |
oh! good fix. i can land this.
Thanks! :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example:
{"ok":true}\n
won't be formatted currently but would be with this fix.