diff --git a/venus/api/common.py b/venus/api/common.py index 17253bc..c33256d 100644 --- a/venus/api/common.py +++ b/venus/api/common.py @@ -206,7 +206,7 @@ def get_request_url(request): forwarded = headers.get('X-Forwarded-Host') if forwarded: url_parts = list(parse.urlsplit(url)) - url_parts[1] = re.split(',\s?', forwarded)[-1] + url_parts[1] = re.split(',\\s?', forwarded)[-1] url = parse.urlunsplit(url_parts).rstrip('/') return url diff --git a/venus/utils.py b/venus/utils.py index 60a9e9c..67d2126 100644 --- a/venus/utils.py +++ b/venus/utils.py @@ -391,7 +391,7 @@ def sanitize_hostname(hostname): hostname = hostname.decode('latin-1') hostname = re.sub('[ _]', '-', hostname) - hostname = re.sub('[^\w.-]+', '', hostname) + hostname = re.sub('[^\\w.-]+', '', hostname) hostname = hostname.lower() hostname = hostname.strip('.-')