Browse Source

cors manual

ash 2 years ago
parent
commit
d25801bcf6
2 changed files with 5 additions and 5 deletions
  1. 5 5
      Backend/Sources/View/view_manager.py
  2. BIN
      requirements.txt

+ 5 - 5
Backend/Sources/View/view_manager.py

@@ -27,8 +27,8 @@ __app__.secret_key = "aseqzdwxc"
 __app__.permanent_session_lifetime = timedelta(minutes=2)
 __app__.logger = logger
 __app__.config['JSONIFY_PRETTYPRINT_REGULAR'] = True
-flask_cors.CORS(__app__)
-logging.getLogger('flask_cors').level = logging.DEBUG
+#flask_cors.CORS(__app__)
+#logging.getLogger('flask_cors').level = logging.DEBUG
 
 limiter = Limiter(__app__,key_func=get_remote_address,default_limits=["100 per minute"])
 limiter.logger = logger
@@ -70,9 +70,9 @@ def after_request(response : flask.Response):
     # and the javascript call some request on another server (origin 2), typically our API.
     #header['Access-Control-Allow-Credentials'] =  'true'
     #header['Access-Control-Allow-Origin']  = '*'
-    #header['Access-Control-Allow-Methods'] = 'GET,DELETE,UPDATE,HEAD,OPTIONS,POST,PUT,PATCH'
-    #header['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
-    #header['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
+    header['Access-Control-Allow-Methods'] = 'GET,DELETE,UPDATE,HEAD,OPTIONS,POST,PUT,PATCH'
+    header['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
+
 
     logger.debug(response.__dict__)
 

BIN
requirements.txt