Turing311 commited on
Commit
3deca81
1 Parent(s): a349fba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -44,6 +44,14 @@ def face_recognition(face_payload):
44
  resp = send_rapidapi(url, face_payload)
45
  return resp
46
 
 
 
 
 
 
 
 
 
47
  @app.route("/")
48
  def index():
49
  return redirect('/id_type')
 
44
  resp = send_rapidapi(url, face_payload)
45
  return resp
46
 
47
+ @app.before_request
48
+ def before_request():
49
+ scheme = request.headers.get('X-Forwarded-Proto')
50
+ if scheme and scheme == 'http' and request.url.startswith('http://'):
51
+ url = request.url.replace('http://', 'https://', 1)
52
+ code = 301
53
+ return redirect(url, code=code)
54
+
55
  @app.route("/")
56
  def index():
57
  return redirect('/id_type')