fixed host check spelling bug
parent
19bab6a3c6
commit
b29e0f0c09
|
@ -118,9 +118,15 @@ class API:
|
||||||
self.validateHost('public')
|
self.validateHost('public')
|
||||||
action = request.args.get('action')
|
action = request.args.get('action')
|
||||||
requestingPeer = request.args.get('myID')
|
requestingPeer = request.args.get('myID')
|
||||||
|
data = request.args.get('data')
|
||||||
if action == 'firstConnect':
|
if action == 'firstConnect':
|
||||||
pass
|
pass
|
||||||
|
elif action == 'ping':
|
||||||
|
resp = Response("pong!")
|
||||||
|
elif action == 'setHMAC':
|
||||||
|
pass
|
||||||
|
|
||||||
|
return resp
|
||||||
|
|
||||||
@app.errorhandler(404)
|
@app.errorhandler(404)
|
||||||
def notfound(err):
|
def notfound(err):
|
||||||
|
@ -154,7 +160,7 @@ class API:
|
||||||
if not request.host.startswith('127'):
|
if not request.host.startswith('127'):
|
||||||
abort(403)
|
abort(403)
|
||||||
elif hostType == 'public':
|
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)
|
abort(403)
|
||||||
# Validate x-requested-with, to protect against CSRF/metadata leaks
|
# Validate x-requested-with, to protect against CSRF/metadata leaks
|
||||||
if not self._developmentMode:
|
if not self._developmentMode:
|
||||||
|
|
Loading…
Reference in New Issue