diff --git a/website/web/__init__.py b/website/web/__init__.py index 7596e479..aee26f51 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -7,6 +7,7 @@ import os from pathlib import Path from datetime import datetime, timedelta import json +import http from flask import Flask, render_template, request, send_file, redirect, url_for, Response, flash, jsonify from flask_bootstrap import Bootstrap # type: ignore @@ -60,6 +61,13 @@ def sizeof_fmt(num, suffix='B'): app.jinja_env.globals.update(sizeof_fmt=sizeof_fmt) +def http_status_description(code: int): + return http.client.responses[code] + + +app.jinja_env.globals.update(http_status_description=http_status_description) + + @app.after_request def after_request(response): ua = request.headers.get('User-Agent') diff --git a/website/web/templates/hostname_popup.html b/website/web/templates/hostname_popup.html index 8cf0cb6d..ebc83afb 100644 --- a/website/web/templates/hostname_popup.html +++ b/website/web/templates/hostname_popup.html @@ -111,7 +111,7 @@
  • {# Details of the response #} -

    Response (Status code: {{ url['url_object'].response['status'] }})

    +

    Response (Status code: {{ url['url_object'].response['status'] }})

    {{ popup_icons(keys_response, url['url_object'], tree_uuid) }} {% if url['url_object'].empty_response %}