calibre-web: fix static environ method in tornado

This commit is contained in:
renesat 2023-09-06 04:47:06 +02:00
parent 05f82739df
commit c53fc9a1e4
2 changed files with 27 additions and 0 deletions

View file

@ -63,6 +63,8 @@ python.pkgs.buildPythonApplication rec {
# and exit. This is gonna be used to configure calibre-web declaratively, as most of its configuration parameters
# are stored in the DB.
./db-migrations.patch
# environ in tornado.wsgi.WSGIContainer no longer a static method from 6.3 version
./static_environ.patch
];
# calibre-web doesn't follow setuptools directory structure. The following is taken from the script

View file

@ -0,0 +1,25 @@
diff --git a/cps/tornado_wsgi.py b/cps/tornado_wsgi.py
index af93219c..cf302042 100644
--- a/cps/tornado_wsgi.py
+++ b/cps/tornado_wsgi.py
@@ -53,7 +53,7 @@ class MyWSGIContainer(WSGIContainer):
return response.append
app_response = self.wsgi_application(
- MyWSGIContainer.environ(request), start_response
+ self.environ(request), start_response
)
try:
response.extend(app_response)
@@ -86,9 +86,8 @@ class MyWSGIContainer(WSGIContainer):
request.connection.finish()
self._log(status_code, request)
- @staticmethod
- def environ(request: httputil.HTTPServerRequest) -> Dict[Text, Any]:
- environ = WSGIContainer.environ(request)
+ def environ(self, request: httputil.HTTPServerRequest) -> Dict[Text, Any]:
+ environ = super().environ(request)
environ['RAW_URI'] = request.path
return environ