Skip to content

Commit

Permalink
Fix HTTPS redirect in case not standard port is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Apr 26, 2015
1 parent b66e111 commit 733043a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tor2web/t2w.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,11 @@ def process(self):

# we serve contents only over HTTPS
if not self.isSecure() and (config.transport != 'HTTP'):
self.redirect("https://" + request.host + request.uri)
if config.listen_port_https == 443:
self.redirect("https://" + request.host + request.uri)
else:
self.redirect("https://" + request.host + ":" + str(config.listen_port_https) + request.uri)

self.finish()
defer.returnValue(None)

Expand Down

0 comments on commit 733043a

Please sign in to comment.