comparison MoinMoin/request.py @ 481:285b42d58a45

minor change: fixed some typos imported from: moin--main--1.5--patch-485
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 18 Mar 2006 19:47:38 +0000
parents 361f1defc4c5
children a594780d5e64
comparison
equal deleted inserted replaced
480:c611a218ae9b 481:285b42d58a45
978 def getQualifiedURL(self, uri=''): 978 def getQualifiedURL(self, uri=''):
979 """ Return an absolute URL starting with schema and host. 979 """ Return an absolute URL starting with schema and host.
980 980
981 Already qualified urls are returned unchanged. 981 Already qualified urls are returned unchanged.
982 982
983 @param uri: server rootted uri e.g /scriptname/pagename. It 983 @param uri: server rooted uri e.g /scriptname/pagename. It
984 must start with a slash. Must be ascii and url encoded. 984 must start with a slash. Must be ascii and url encoded.
985 """ 985 """
986 import urlparse 986 import urlparse
987 scheme = urlparse.urlparse(uri)[0] 987 scheme = urlparse.urlparse(uri)[0]
988 if scheme: 988 if scheme:
989 return uri 989 return uri
990 990
991 schema = ('http', 'https')[self.is_ssl] 991 scheme = ('http', 'https')[self.is_ssl]
992 result = "%s://%s%s" % (schema, self.http_host, uri) 992 result = "%s://%s%s" % (scheme, self.http_host, uri)
993 993
994 # This might break qualified urls in redirects! 994 # This might break qualified urls in redirects!
995 # e.g. mapping 'http://netloc' -> '/' 995 # e.g. mapping 'http://netloc' -> '/'
996 return wikiutil.mapURL(self, result) 996 return wikiutil.mapURL(self, result)
997 997