Commit df05e7c7 authored by Luca Braun's avatar Luca Braun

Added https forwarding to role-stage discovery

parent 8d07201d
...@@ -16,10 +16,19 @@ import connexion ...@@ -16,10 +16,19 @@ import connexion
from security import swagger_util from security import swagger_util
from pathlib import Path from pathlib import Path
from env_info import is_running_locally, get_resources_path from env_info import is_running_locally, get_resources_path
from flask import request
from flask import redirect
# load swagger config # load swagger config
app = connexion.App(__name__, specification_dir='configs/') app = connexion.App(__name__, specification_dir='configs/')
@app.app.before_request
def before_request():
if request.url.startswith('http://'):
url = request.url.replace('http://', 'https://', 1)
code = 301
return redirect(url, code=code)
@app.route('/', methods=['GET']) @app.route('/', methods=['GET'])
def api_root(): def api_root():
return 'Endpoint of role-stage-discovery-microservice!' return 'Endpoint of role-stage-discovery-microservice!'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment