Index: third_party/upload.py |
diff --git a/third_party/upload.py b/third_party/upload.py |
index b2a5193ad850204070059bf9b549bae497a14c7e..744f3d6794d9c1010b1b3cc0b853df3d91aa5116 100755 |
--- a/third_party/upload.py |
+++ b/third_party/upload.py |
@@ -424,7 +424,7 @@ class AbstractRpcServer(object): |
""" |
# TODO: Don't require authentication. Let the server say |
# whether it is necessary. |
- if not self.authenticated: |
+ if not self.authenticated and self.auth_function: |
self._Authenticate() |
old_timeout = socket.getdefaulttimeout() |
@@ -451,6 +451,8 @@ class AbstractRpcServer(object): |
if tries > 3: |
raise |
elif e.code == 401 or e.code == 302: |
+ if not self.auth_function: |
+ raise |
self._Authenticate() |
elif e.code == 301: |
# Handle permanent redirect manually. |