This commit is contained in:
Markus Heiser 2024-11-01 12:43:29 +00:00 committed by GitHub
commit 07fff4e195
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -17,9 +17,6 @@
{% else %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/searxng.min.css') }}" type="text/css" media="screen">
{% endif %}
{% if get_setting('server.limiter') or get_setting('server.public_instance') %}
<link rel="stylesheet" href="{{ url_for('client_token', token=link_token) }}" type="text/css">
{% endif %}
{% block styles %}{% endblock %}
<!--[if gte IE 9]>-->
<script src="{{ url_for('static', filename='js/searxng.head.min.js') }}" client_settings="{{ client_settings }}"></script>
@ -86,5 +83,8 @@
<!--[if gte IE 9]>-->
<script src="{{ url_for('static', filename='js/searxng.min.js') }}"></script>
<!--<![endif]-->
{%- if get_setting('server.limiter') -%}
<img class='invisible' src="{{ url_for('client_token', token=link_token) }}">
{%- endif -%}
</body>
</html>

View File

@ -617,10 +617,12 @@ def health():
return Response('OK', mimetype='text/plain')
@app.route('/client<token>.css', methods=['GET', 'POST'])
@app.route('/client<token>.svg', methods=['GET', 'POST'])
def client_token(token=None):
link_token.ping(request, token)
return Response('', mimetype='text/css')
resp = Response('<svg></svg>', mimetype='image/svg+xml')
resp.headers['Cache-Control'] = 'no-store'
return resp
@app.route('/search', methods=['GET', 'POST'])