fix(ty): check for response status_code type
This commit is contained in:
+6
-1
@@ -166,7 +166,12 @@ class BaseHandler(abc.ABC, http.server.BaseHTTPRequestHandler):
|
||||
http.HTTPStatus.BAD_GATEWAY, f"Could not reach {url}", explain=str(e)
|
||||
)
|
||||
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():
|
||||
if header.lower() not in [
|
||||
"content-length",
|
||||
|
||||
Reference in New Issue
Block a user