From 91188bf38b94acc02822cd4c69375ef0dda53912 Mon Sep 17 00:00:00 2001 From: Paul TREHIOU Date: Fri, 26 Jul 2024 15:55:50 +0200 Subject: [PATCH] Fix inconsistent HTTPStatus string representation (#60) In some python environments, HTTPStatus conversion to string will not result in their value but in their repr ("" instead of "200") --- a2wsgi/asgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a2wsgi/asgi.py b/a2wsgi/asgi.py index 2c52bad..2692325 100644 --- a/a2wsgi/asgi.py +++ b/a2wsgi/asgi.py @@ -21,7 +21,7 @@ def __missing__(self, key): StatusStringMapping = defaultdict( lambda status: f"{status} Unknown Status Code", - {int(status): f"{status} {status.phrase}" for status in HTTPStatus}, + {status.value: f"{status.value} {status.phrase}" for status in HTTPStatus}, )