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)
|
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",
|
||||||
|
|||||||
Reference in New Issue
Block a user