Fix CORS: Configure Flask-CORS properly to avoid duplicate headers
This commit is contained in:
parent
313e60ccef
commit
fe9819de58
|
|
@ -23,7 +23,14 @@ if Config.ENCRYPTION_KEY:
|
||||||
os.environ['ENCRYPTION_KEY'] = Config.ENCRYPTION_KEY
|
os.environ['ENCRYPTION_KEY'] = Config.ENCRYPTION_KEY
|
||||||
|
|
||||||
# Extensions
|
# Extensions
|
||||||
CORS(app)
|
# CORS - Allow only from argeict.net
|
||||||
|
CORS(app, resources={
|
||||||
|
r"/api/*": {
|
||||||
|
"origins": ["https://argeict.net"],
|
||||||
|
"methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
||||||
|
"allow_headers": ["Content-Type", "Authorization"]
|
||||||
|
}
|
||||||
|
})
|
||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
migrate = Migrate(app, db)
|
migrate = Migrate(app, db)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue