summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <ford_prefect@gentoo.org>2009-03-09 01:18:54 +0530
committerArun Raghavan <ford_prefect@gentoo.org>2009-03-09 01:18:54 +0530
commit730e003b548ed9783f48da9bf91bfa144c1ba89a (patch)
tree7bcd051e4f2bc95ae679cb4eb7d7c8faab4a623b
parentAdd a timeout for http/ftp connections (diff)
downloadgard-730e003b548ed9783f48da9bf91bfa144c1ba89a.tar.gz
gard-730e003b548ed9783f48da9bf91bfa144c1ba89a.tar.bz2
gard-730e003b548ed9783f48da9bf91bfa144c1ba89a.zip
Strip trailing '/'s from URLs
This was causing the addition of double slashes while concatenating URLs. Curse you, Shyam Mani! :P
-rw-r--r--check.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/check.py b/check.py
index 0f6aebb..e6b875f 100644
--- a/check.py
+++ b/check.py
@@ -14,7 +14,9 @@ import urlparse
class GardCheck:
# Base class which provides some helper functions
def __init__(self, url, log=True, timeout=30):
- self.url = url
+ # Munge trailing '/' so we can sanely concatenate paths later
+ self.url = url.rstrip('/')
+
if log:
self.logger = logging.getLogger('')
else: