From 55ec1d8965a401dc02f2fd917084aaa05c837364 Mon Sep 17 00:00:00 2001 From: "jabdelmalek@google.com" Date: Tue, 27 Apr 2010 22:38:29 +0000 Subject: [PATCH] Bring in upload.py changes to allow uploading over https git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@45745 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/upload.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/third_party/upload.py b/third_party/upload.py index 7d6112847..9332c9281 100755 --- a/third_party/upload.py +++ b/third_party/upload.py @@ -164,6 +164,9 @@ class AbstractRpcServer(object): implement this functionality. Defaults to False. """ self.host = host + if (not self.host.startswith("http://") and + not self.host.startswith("https://")): + self.host = "http://" + self.host; self.host_override = host_override self.auth_function = auth_function self.authenticated = False @@ -274,7 +277,7 @@ class AbstractRpcServer(object): # This is a dummy value to allow us to identify when we're successful. continue_location = "http://localhost/" args = {"continue": continue_location, "auth": auth_token} - req = self._CreateRequest("http://%s/_ah/login?%s" % + req = self._CreateRequest("%s/_ah/login?%s" % (self.host, urllib.urlencode(args))) try: response = self.opener.open(req) @@ -367,7 +370,7 @@ class AbstractRpcServer(object): while True: tries += 1 args = dict(kwargs) - url = "http://%s%s" % (self.host, request_path) + url = "%s%s" % (self.host, request_path) if args: url += "?" + urllib.urlencode(args) req = self._CreateRequest(url=url, data=payload)