From 1a2562c2f9a368dbe0fc03264fb387e44313213b Mon Sep 17 00:00:00 2001 From: Stijn Peeters Date: Sat, 14 Sep 2024 15:53:27 +0200 Subject: [PATCH] Debug panel for HTTP headers in control panel --- webtool/templates/controlpanel/logs.html | 7 +++++++ webtool/views/views_admin.py | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/webtool/templates/controlpanel/logs.html b/webtool/templates/controlpanel/logs.html index b30ac0460..42d6313f2 100644 --- a/webtool/templates/controlpanel/logs.html +++ b/webtool/templates/controlpanel/logs.html @@ -20,5 +20,12 @@

stderr of backend daemon

Loading log file... + +
+

HTTP request headers

+
+{{ headers }}
+            
+
{% endblock %} diff --git a/webtool/views/views_admin.py b/webtool/views/views_admin.py index baffcc787..c7fe01c2a 100644 --- a/webtool/views/views_admin.py +++ b/webtool/views/views_admin.py @@ -720,7 +720,8 @@ def view_logs(): :return: """ - return render_template("controlpanel/logs.html") + headers = "\n".join([f"{h}: {request.headers[h]}" for h in dict(request.headers)]) + return render_template("controlpanel/logs.html", headers=headers) @app.route("/logs//")