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

Unified Diff: third_party/upload.py

Issue 5339001: Add a regexp to verify the host parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Improve regexp to support port number Created 10 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/upload.py
diff --git a/third_party/upload.py b/third_party/upload.py
index 279221412277035037f77515eb91b42b2c507913..c532cd815e118d78187c1c85ffc378c12cd60c23 100644
--- a/third_party/upload.py
+++ b/third_party/upload.py
@@ -188,6 +188,8 @@ class AbstractRpcServer(object):
if (not self.host.startswith("http://") and
not self.host.startswith("https://")):
self.host = "http://" + self.host
+ assert re.match(r'^[a-z]+://[a-z0-9\.-_]+[a-z](|:[0-9]+)$', self.host), (
+ '%s is malformed' % host)
self.host_override = host_override
self.auth_function = auth_function
self.authenticated = False
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698