changeset 10675:3c05ecffe20d stable

hgweb: make code to join url path simpler Now SCRIPT_NAME never contains http://host:port part, we don't need to care about '://'.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 11 Mar 2010 00:28:31 +0900
parents 6d87c20cd7a8
children 13341047d517 3b3bf520b428
files mercurial/hgweb/hgwebdir_mod.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Thu Mar 11 00:28:27 2010 +0900
+++ b/mercurial/hgweb/hgwebdir_mod.py	Thu Mar 11 00:28:31 2010 +0900
@@ -229,9 +229,7 @@
                     parts.insert(0, req.env['PATH_INFO'].rstrip('/'))
                 if req.env['SCRIPT_NAME']:
                     parts.insert(0, req.env['SCRIPT_NAME'])
-                m = re.match('((?:https?://)?)(.*)', '/'.join(parts))
-                # squish repeated slashes out of the path component
-                url = m.group(1) + re.sub('/+', '/', m.group(2)) + '/'
+                url = re.sub(r'/+', '/', '/'.join(parts) + '/')
 
                 # update time with local timezone
                 try: