支持免登录游客聊天并隔离历史与附件

This commit is contained in:
2026-10-30 12:17:43 +08:00
parent e58dd86d5b
commit 147edd042f
36 changed files with 663 additions and 129 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ from flask import current_app, jsonify, request
def rate_limit():
path = request.path
if path == '/healthz' or path.startswith('/static') or path.startswith('/api/human/'):
if path in ('/healthz', '/api/visitor/human/poll') or path.startswith('/static') or path.startswith('/api/human/'):
return None
ip = request.remote_addr or 'unknown'
now = time.time()
@@ -21,7 +21,7 @@ def rate_limit():
def no_cache_html(response):
if response.mimetype in ('text/html', 'text/event-stream'):
if response.mimetype in ('text/html', 'text/event-stream') or request.path.startswith('/api/'):
response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate'
response.headers['Pragma'] = 'no-cache'
response.headers['Expires'] = '0'