changeset 286:c0508545f8e5

Absolute URLs work with endpoint URLs too.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 27 Sep 2014 14:06:45 -0700
parents bdc682d02427
children 3eef607e62d4
files wikked/utils.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/wikked/utils.py	Sat Sep 27 14:06:21 2014 -0700
+++ b/wikked/utils.py	Sat Sep 27 14:06:45 2014 -0700
@@ -48,7 +48,7 @@
 
 
 def get_absolute_url(base_url, url, quote=False):
-    base_url = strip_endpoint_regex.sub('', base_url)
+    endpoint, base_url = split_page_url(base_url)
     if base_url[0] != '/':
         raise ValueError("The base URL must be absolute. Got: %s" % base_url)
 
@@ -68,6 +68,8 @@
         abs_url = os.path.normpath(raw_abs_url).replace('\\', '/')
     if quote:
         abs_url = urllib.quote(abs_url.encode('utf-8'))
+    if endpoint:
+        return '%s:%s' % (endpoint, abs_url)
     return abs_url