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):
4646 app .logger .setLevel (logging .INFO )
4747 add_debug_toolbar (app )
4848
49+ add_proxy_fix_to_serve_swagger_over_https (app )
50+
4951 cors_origins = app .config .get ('CORS_ORIGINS' )
5052 if cors_origins :
5153 enable_cors (app , cors_origins )
@@ -74,3 +76,9 @@ def enable_cors(app: Flask, cors_origins: str):
7476 cors_origins_list = cors_origins .split ("," )
7577 CORS (app , resources = {r"/*" : {"origins" : cors_origins_list }})
7678 app .logger .info ("Set CORS access to [%s]" % cors_origins )
79+
80+
81+ def add_proxy_fix_to_serve_swagger_over_https (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 ("Set ProxyFix to serve swagger over https." )
You can’t perform that action at this time.
0 commit comments