Skip to content

Commit

Permalink
Debug panel for HTTP headers in control panel
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Sep 14, 2024
1 parent 203314e commit 1a2562c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions webtool/templates/controlpanel/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,12 @@ <h2><span>stderr of backend daemon</span></h2>
Loading log file...
</pre>
</section>

<section>
<h2><span>HTTP request headers</span></h2>
<pre id="http-log" class="content-container">
{{ headers }}
</pre>
</section>
</article>
{% endblock %}
3 changes: 2 additions & 1 deletion webtool/views/views_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<string:logfile>/")
Expand Down

0 comments on commit 1a2562c

Please sign in to comment.