diff --git a/src/endpoints/unknown.py b/src/endpoints/unknown.py index f76d73f..eb80eea 100644 --- a/src/endpoints/unknown.py +++ b/src/endpoints/unknown.py @@ -25,3 +25,28 @@ def inventory_unlock_special_items(): return jsonify({"status": "error"}) except Exception as e: logger.graylog_logger(level="error", handler="unknown_unlockSpecialItems", message=str(e)) + + +@app.errorhandler(404) +def debug_404(e): + print("##################################################################################") + print("DEBUG 404") + print("##################################################################################") + print('HTTP Headers:') + for header in request.headers: + print(f'{header[0]}: {header[1]}') + + print('Cookies:') + for key, value in request.cookies.items(): + print(f'{key}: {value}') + + print('Endpoint: ', request.endpoint) + print('Path: ', request.path) + print('Method: ', request.method) + + if request.json: + print('JSON Payload:') + print(request.json) + + print("##################################################################################") + return jsonify({"status": "error", "code": 404})