refactor(proxy): parse a three-digit string status without recursing

This commit is contained in:
mateo-berri 2026-10-30 00:35:39 -07:00
parent cfec5a12e4
commit 1a0b73403d

View file

@ -65,8 +65,8 @@ def _http_error_status(value: object) -> int | None:
return None
case int() if value in _HTTP_ERROR_STATUSES:
return value
case str() if len(value) == 3 and value.isascii() and value.isdigit():
return _http_error_status(int(value))
case str() if len(value) == 3 and value.isascii() and value.isdigit() and int(value) in _HTTP_ERROR_STATUSES:
return int(value)
case _:
return None