From 06f92a32288dee770eb9bf83dd492662d34ccdd9 Mon Sep 17 00:00:00 2001 From: Boyan Date: Mon, 3 Feb 2025 21:07:08 +0100 Subject: [PATCH] Added flatcher --- flatcher | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 flatcher diff --git a/flatcher b/flatcher new file mode 100755 index 0000000..22b7c47 --- /dev/null +++ b/flatcher @@ -0,0 +1,19 @@ +#!/usr/bin/python +from flask import Flask, request + +app = Flask(__name__) + +@app.route('/', defaults={'path': ''}, methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS']) +@app.route('/', methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS']) +def capture_request(path): + """ + This route captures all requests, regardless of method or path. + """ + print(f"Request Path: {request.path}") + print(f"Request Method: {request.method}") + print(f"Request Headers: {dict(request.headers)}") + print(f"Request Body: {request.get_data(as_text=True)}") + return "Request captured and printed to the console!", 200 + +if __name__ == '__main__': + app.run(debug=True, host='0.0.0.0', port=5000)