Logging tidy-up, IDE inspection fixes

This commit is contained in:
Ian Renton
2026-08-15 07:42:38 +01:00
parent 9cd6d9c177
commit bff5b79f8f
40 changed files with 128 additions and 125 deletions
+10 -7
View File
@@ -1,5 +1,7 @@
import tornado
from tornado.httpclient import AsyncHTTPClient
from tornado.httputil import HTTPHeaders
class V1RedirectHandler(tornado.web.RequestHandler):
"""Transparently proxies requests from the old API to the new one,
@@ -30,13 +32,14 @@ class V1RedirectHandler(tornado.web.RequestHandler):
raise tornado.web.HTTPError(502, reason=str(e))
self.set_status(response.code, response.reason)
for name, value in response.headers.get_all():
# Let Tornado recompute these for the outgoing response
if name.lower() not in ("content-length", "transfer-encoding", "connection"):
self.add_header(name, value)
if response.body:
self.write(response.body)
self.finish()
if isinstance(response.headers, HTTPHeaders):
for name, value in response.headers.get_all():
# Let Tornado recompute these for the outgoing response
if name.lower() not in ("content-length", "transfer-encoding", "connection"):
self.add_header(name, value)
if response.body:
self.write(response.body)
await self.finish()
async def get(self, path):
await self._proxy(path)