fix(ty): check for response status_code type

This commit is contained in:
2026-04-30 22:40:39 +02:00
parent a02a1ad53b
commit ccd1ac9ffb
+6 -1
View File
@@ -166,7 +166,12 @@ class BaseHandler(abc.ABC, http.server.BaseHTTPRequestHandler):
http.HTTPStatus.BAD_GATEWAY, f"Could not reach {url}", explain=str(e) http.HTTPStatus.BAD_GATEWAY, f"Could not reach {url}", explain=str(e)
) )
return return
self.send_response(response.status_code, response.reason) self.send_response(
response.status_code
if type(response.status_code) is int
else http.HTTPStatus.BAD_GATEWAY,
response.reason,
)
for header, value in response.headers.items(): for header, value in response.headers.items():
if header.lower() not in [ if header.lower() not in [
"content-length", "content-length",