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

Unified Diff: presubmit_canned_checks.py

Issue 6712007: Check for a missing scheme in the input_api.host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 9 years, 9 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
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
===================================================================
--- presubmit_canned_checks.py (revision 78512)
+++ presubmit_canned_checks.py (working copy)
@@ -655,8 +655,12 @@
if not input_api.change.issue:
return []
- path = '/api/%s?messages=true'
- url = (input_api.host_url + path) % input_api.change.issue
+ # TODO(dpranke): Should figure out if input_api.host_url is supposed to
M-A Ruel 2011/03/17 19:12:54 There's also the problem that some issues needs to
+ # be a host or a scheme+host and normalize it there.
+ host = input_api.host_url
+ if not host.startswith('http://'):
M-A Ruel 2011/03/17 19:43:34 Some host are https:// only, please take that in a
+ host = 'http://' + host
+ url = '%s/api/%s?messages=true' % (host, input_api.change.issue)
f = input_api.urllib2.urlopen(url)
issue_props = input_api.json.load(f)
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698