Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,15 @@ from datetime import datetime
|
|
8 |
from elo_rank import EloRank
|
9 |
|
10 |
app = Flask(__name__)
|
11 |
-
CORS(app)
|
|
|
12 |
app.secret_key = 'supersecretkey'
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
base_dir = os.path.dirname(os.path.abspath(__file__))
|
15 |
|
16 |
DATA_DIR = os.path.join(base_dir, '/app/data')
|
|
|
8 |
from elo_rank import EloRank
|
9 |
|
10 |
app = Flask(__name__)
|
11 |
+
CORS(app, supports_credentials=True)
|
12 |
+
|
13 |
app.secret_key = 'supersecretkey'
|
14 |
|
15 |
+
app.config['SESSION_COOKIE_SECURE'] = False # 开发环境中关闭 HTTPS 限制
|
16 |
+
app.config['SESSION_COOKIE_HTTPONLY'] = True # 防止 JavaScript 访问 Cookie
|
17 |
+
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax' # 确保跨站请求时 Cookie 被正确传递
|
18 |
+
|
19 |
+
|
20 |
base_dir = os.path.dirname(os.path.abspath(__file__))
|
21 |
|
22 |
DATA_DIR = os.path.join(base_dir, '/app/data')
|