This commit is contained in:
Bearz314 2025-02-11 01:24:17 +11:00 committed by GitHub
commit 2ec7210272
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 2 deletions

View File

@ -175,3 +175,4 @@ features or generally made searx better:
- Daniel Kukula `<https://github.com/dkuku>` - Daniel Kukula `<https://github.com/dkuku>`
- Patrick Evans `https://github.com/holysoles` - Patrick Evans `https://github.com/holysoles`
- Daniel Mowitz `<https://daniel.mowitz.rocks>` - Daniel Mowitz `<https://daniel.mowitz.rocks>`
- `Bearz314 <https://github.com/bearz314>`_

View File

@ -123,7 +123,9 @@ def filter_request(
) )
if c > SUSPICIOUS_IP_MAX: if c > SUSPICIOUS_IP_MAX:
logger.error("BLOCK: too many request from %s in SUSPICIOUS_IP_WINDOW (redirect to /)", network) logger.error("BLOCK: too many request from %s in SUSPICIOUS_IP_WINDOW (redirect to /)", network)
return flask.redirect(flask.url_for('index'), code=302) response = flask.redirect(flask.url_for('index'), code=302)
response.headers["Cache-Control"] = "no-store, max-age=0"
return response
c = incr_sliding_window(redis_client, 'ip_limit.BURST_WINDOW' + network.compressed, BURST_WINDOW) c = incr_sliding_window(redis_client, 'ip_limit.BURST_WINDOW' + network.compressed, BURST_WINDOW)
if c > BURST_MAX_SUSPICIOUS: if c > BURST_MAX_SUSPICIOUS:

View File

@ -594,7 +594,7 @@ def health():
@app.route('/client<token>.css', methods=['GET', 'POST']) @app.route('/client<token>.css', methods=['GET', 'POST'])
def client_token(token=None): def client_token(token=None):
link_token.ping(sxng_request, token) link_token.ping(sxng_request, token)
return Response('', mimetype='text/css') return Response('', mimetype='text/css', headers={"Cache-Control": "no-store, max-age=0"})
@app.route('/rss.xsl', methods=['GET', 'POST']) @app.route('/rss.xsl', methods=['GET', 'POST'])