Skip to content

Commit

Permalink
Implement feature #209
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Feb 22, 2015
1 parent 956cb96 commit 5ca6ed7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tor2web/t2w.py
Expand Up @@ -921,11 +921,15 @@ def process(self):

# we need to verify if the user is using tor;
# on this condition it's better to redirect on the .onion
if not config.disable_tor_redirection:
if self.getClientIP() in tor_exits_list:
if self.getClientIP() in tor_exits_list:
self.setHeader(b'X-Check-Tor', b'true')
if not config.disable_tor_redirection:
self.redirect("http://" + self.obj.onion + request.uri)
self.finish()
defer.returnValue(None)
else:
self.setHeader(b'X-Check-Tor', b'false')


# Avoid image hotlinking
if config.blockhotlinking and request.uri.lower().endswith(tuple(config.blockhotlinking_exts)):
Expand Down

0 comments on commit 5ca6ed7

Please sign in to comment.