Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2553)

Unified Diff: dashboard/dashboard/services/request.py

Issue 3019553002: [pinpoint] Gerrit patch support. (Closed)
Patch Set: Example URL Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dashboard/dashboard/services/request.py
diff --git a/dashboard/dashboard/services/request.py b/dashboard/dashboard/services/request.py
index 9ffc59e7b6aa3c87e1b85f3f2c95cebe667344ab..8799c08eea93e5b354ad47d737ca55dd52fdef76 100644
--- a/dashboard/dashboard/services/request.py
+++ b/dashboard/dashboard/services/request.py
@@ -9,13 +9,19 @@ import urllib
from dashboard.common import utils
+_VULNERABILITY_PREFIX = ")]}'\n"
+
+
def RequestJson(*args, **kwargs):
"""Fetch a URL and JSON-decode the response.
See the documentation for Request() for details
about the arguments and exceptions.
"""
- return json.loads(Request(*args, **kwargs))
+ content = Request(*args, **kwargs)
+ if content.startswith(_VULNERABILITY_PREFIX):
+ content = content[len(_VULNERABILITY_PREFIX):]
+ return json.loads(content)
def Request(url, method='GET', body=None, **parameters):

Powered by Google App Engine
This is Rietveld 408576698