Skip to content

Commit

Permalink
Fix inconsistent HTTPStatus string representation (#60)
Browse files Browse the repository at this point in the history
In some python environments, HTTPStatus conversion to string will not result in their value but in their repr ("<HTTPStatus.OK: 200>" instead of "200")
  • Loading branch information
nyanloutre authored Jul 26, 2024
1 parent 5cf9208 commit 91188bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion a2wsgi/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
)


Expand Down

0 comments on commit 91188bf

Please sign in to comment.