diff --git a/src/endpoints/unknown.py b/src/endpoints/unknown.py index c6fd127..3350479 100644 --- a/src/endpoints/unknown.py +++ b/src/endpoints/unknown.py @@ -26,3 +26,28 @@ def inventory_unlock_special_items(): return jsonify({"status": "error"}) except Exception as e: 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})