Browse Source

[fix] limiter: prevent caching of token link

Depending on server and client setup, this CSS link with empty content may be cached.
For example, in my setup CloudFlare automatically adds 14400s (4hours) in my test.
This prevents caching by browser and proxies so the CSS can be reliably requested.
bearz314 2 months ago
parent
commit
16fafed6a2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      searx/webapp.py

+ 1 - 1
searx/webapp.py

@@ -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'])