forked from pool/trytond
OBS-URL: https://build.opensuse.org/package/show/Application:ERP:GNUHealth:Factory/trytond?expand=0&rev=168
This commit is contained in:
parent
4d4cb10299
commit
4f539b0dfc
@ -1,38 +0,0 @@
|
||||
diff -U 3 -dHrN -- a/trytond/wsgi.py b/trytond/wsgi.py
|
||||
--- a/trytond/wsgi.py 2021-02-12 10:14:41.000000000 +0100
|
||||
+++ b/trytond/wsgi.py 2021-02-15 12:37:50.432511576 +0100
|
||||
@@ -10,13 +10,23 @@
|
||||
from werkzeug.wrappers import Response
|
||||
from werkzeug.routing import Map, Rule
|
||||
from werkzeug.exceptions import abort, HTTPException, InternalServerError
|
||||
-from werkzeug.contrib.fixers import ProxyFix
|
||||
+try:
|
||||
+ from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
+
|
||||
+ def NumProxyFix(app, num_proxies):
|
||||
+ return ProxyFix(app,
|
||||
+ x_for=num_proxies, x_proto=num_proxies, x_host=num_proxies,
|
||||
+ x_port=num_proxies, x_prefix=num_proxies)
|
||||
+except ImportError:
|
||||
+ from werkzeug.contrib.fixers import ProxyFix as NumProxyFix
|
||||
try:
|
||||
from werkzeug.security import safe_join
|
||||
except ImportError:
|
||||
safe_join = posixpath.join
|
||||
-
|
||||
-from werkzeug.wsgi import SharedDataMiddleware
|
||||
+try:
|
||||
+ from werkzeug.middleware.shared_data import SharedDataMiddleware
|
||||
+except ImportError:
|
||||
+ from werkzeug.wsgi import SharedDataMiddleware
|
||||
|
||||
import wrapt
|
||||
|
||||
@@ -157,6 +167,6 @@
|
||||
app.wsgi_app = SharedDataMiddlewareIndex(app.wsgi_app, static_files)
|
||||
num_proxies = config.getint('web', 'num_proxies')
|
||||
if num_proxies:
|
||||
- app.wsgi_app = ProxyFix(app.wsgi_app, num_proxies=num_proxies)
|
||||
+ app.wsgi_app = NumProxyFix(app.wsgi_app, num_proxies)
|
||||
import trytond.protocols.dispatcher
|
||||
import trytond.bus
|
Loading…
Reference in New Issue
Block a user