Fix CORS: Configure Flask-CORS properly to avoid duplicate headers

This commit is contained in:
oguz ozturk 2026-01-10 17:58:32 +03:00
parent 313e60ccef
commit fe9819de58
1 changed files with 8 additions and 1 deletions

View File

@ -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)