fix: убрать Connection: close — Waitress/WSGI запрещает hop-by-hop заголовки
Deploy drhider / validate (push) Waiting to run
Deploy drhider / validate (push) Waiting to run
This commit is contained in:
+2
-3
@@ -20,7 +20,7 @@ if _sys_path_root not in sys.path:
|
|||||||
sys.path.insert(0, _sys_path_root)
|
sys.path.insert(0, _sys_path_root)
|
||||||
|
|
||||||
# Версия приложения (меняется при изменениях)
|
# Версия приложения (меняется при изменениях)
|
||||||
VERSION = "0.0.21"
|
VERSION = "0.0.22"
|
||||||
|
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
@@ -45,13 +45,12 @@ def create_app():
|
|||||||
|
|
||||||
register_routes(app)
|
register_routes(app)
|
||||||
|
|
||||||
# Запрещаем кэширование и keep-alive — F5 всегда чистое соединение
|
# Запрещаем кэширование — F5 всегда грузит свежую страницу
|
||||||
@app.after_request
|
@app.after_request
|
||||||
def no_cache(response):
|
def no_cache(response):
|
||||||
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
|
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
|
||||||
response.headers["Pragma"] = "no-cache"
|
response.headers["Pragma"] = "no-cache"
|
||||||
response.headers["Expires"] = "0"
|
response.headers["Expires"] = "0"
|
||||||
response.headers["Connection"] = "close"
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ def process_stream(sid):
|
|||||||
return Response(
|
return Response(
|
||||||
stream_with_context(generate()),
|
stream_with_context(generate()),
|
||||||
content_type="text/event-stream",
|
content_type="text/event-stream",
|
||||||
headers={"Cache-Control": "no-cache", "X-Accel-Buffering": "no", "Connection": "close"}
|
headers={"Cache-Control": "no-cache", "X-Accel-Buffering": "no"}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user