Changed 403 respones to 401s in RESTful API

1.6
Harmj0y 2016-04-03 23:15:57 -04:00
parent b56e5d29ec
commit 5e87f7d417
1 changed files with 2 additions and 2 deletions

4
empire
View File

@ -209,9 +209,9 @@ def start_restful_api(startEmpire=False, suppress=False, username=None, password
if request.path != '/api/admin/login': if request.path != '/api/admin/login':
token = request.args.get('token') token = request.args.get('token')
if (not token) or (not tokenAllowed.match(token)): if (not token) or (not tokenAllowed.match(token)):
return make_response('', 403) return make_response('', 401)
if (token != apiToken) and (token != permanentApiToken): if (token != apiToken) and (token != permanentApiToken):
return make_response('', 403) return make_response('', 401)
@app.errorhandler(Exception) @app.errorhandler(Exception)