File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ def init_app(app: Flask):
46
46
app .logger .setLevel (logging .INFO )
47
47
add_debug_toolbar (app )
48
48
49
+ add_werkzeug_proxy_fix (app )
50
+
49
51
cors_origins = app .config .get ('CORS_ORIGINS' )
50
52
if cors_origins :
51
53
enable_cors (app , cors_origins )
@@ -74,3 +76,9 @@ def enable_cors(app: Flask, cors_origins: str):
74
76
cors_origins_list = cors_origins .split ("," )
75
77
CORS (app , resources = {r"/*" : {"origins" : cors_origins_list }})
76
78
app .logger .info ("Set CORS access to [%s]" % cors_origins )
79
+
80
+
81
+ def add_werkzeug_proxy_fix (app : Flask ):
82
+ from werkzeug .middleware .proxy_fix import ProxyFix
83
+ app .wsgi_app = ProxyFix (app .wsgi_app , x_proto = 1 , x_host = 1 )
84
+ app .logger .info ("Add ProxyFix to serve swagger.json over https." )
You can’t perform that action at this time.
0 commit comments