支持免登录游客聊天并隔离历史与附件
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user