fixed host check spelling bug

This commit is contained in:
Kevin Froman 2018-01-18 01:49:13 -06:00
parent 19bab6a3c6
commit b29e0f0c09
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
1 changed files with 8 additions and 2 deletions

View File

@ -118,9 +118,15 @@ class API:
self.validateHost('public')
action = request.args.get('action')
requestingPeer = request.args.get('myID')
data = request.args.get('data')
if action == 'firstConnect':
pass
elif action == 'ping':
resp = Response("pong!")
elif action == 'setHMAC':
pass
return resp
@app.errorhandler(404)
def notfound(err):
@ -154,7 +160,7 @@ class API:
if not request.host.startswith('127'):
abort(403)
elif hostType == 'public':
if not request.host.endswith('onion') and not request.hosst.endswith('i2p'):
if not request.host.endswith('onion') and not request.host.endswith('i2p'):
abort(403)
# Validate x-requested-with, to protect against CSRF/metadata leaks
if not self._developmentMode: