Skip to content

Commit

Permalink
Apply patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
mithrandi committed Feb 4, 2016
1 parent 515a512 commit f9a1914
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion xmantissa/publicweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def beforeRender(self, ctx):
action' and 'error' slots in the template accordingly.
"""
generator = ixmantissa.ISiteURLGenerator(self.store)
url = generator.rootURL(IRequest(ctx))
url = URL.fromString('/')
url = url.child('__login__')
for seg in self.segments:
url = url.child(seg)
Expand Down
11 changes: 6 additions & 5 deletions xmantissa/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ def rootURL(self, request):
this website is available.
"""
host = request.getHeader('host') or self.hostname
if ':' in host:
host = host.split(':', 1)[0]
if (host == self.hostname or
host.startswith('www.') and host[len('www.'):] == self.hostname):
#if ':' in host:
# host = host.split(':', 1)[0]
#if (host == self.hostname or
# host.startswith('www.') and host[len('www.'):] == self.hostname):
if True:
return URL(scheme='', netloc='', pathsegs=[''])
else:
if request.isSecure():
Expand Down Expand Up @@ -365,7 +366,7 @@ def renderHTTP(self, context):
"""
if getattr(self.wrappedResource, 'needsSecure', False):
request = IRequest(context)
url = self.urlGenerator.encryptedRoot()
url = self.urlGenerator.encryptedRoot(request.getHeader('Host'))
if url is not None:
for seg in request.prepath:
url = url.child(seg)
Expand Down

0 comments on commit f9a1914

Please sign in to comment.