diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2023-04-19 17:20:03 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-05-29 14:54:56 +0200 |
commit | dba569462d0e9c4dbd77a54bb42ef5c3b1916142 (patch) | |
tree | 0f536daed5addae98560806e760e9db08d22e49e /searx/webapp.py | |
parent | c1b5ff7e1c28b9a412cac391ce17194d55cc8ee7 (diff) | |
download | searxng-dba569462d0e9c4dbd77a54bb42ef5c3b1916142.tar.gz searxng-dba569462d0e9c4dbd77a54bb42ef5c3b1916142.zip |
[mod] limiter: reduce request rates for requests without a ping
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-x | searx/webapp.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 79255652f..67265e542 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -93,7 +93,7 @@ from searx.utils import ( ) from searx.version import VERSION_STRING, GIT_URL, GIT_BRANCH from searx.query import RawTextQuery -from searx.plugins import Plugin, plugins, initialize as plugin_initialize +from searx.plugins import limiter, Plugin, plugins, initialize as plugin_initialize from searx.plugins.oa_doi_rewrite import get_doi_resolver from searx.preferences import ( Preferences, @@ -642,6 +642,12 @@ def health(): return Response('OK', mimetype='text/plain') +@app.route('/limiter.css', methods=['GET', 'POST']) +def limiter_css(): + limiter.ping() + return Response('', mimetype='text/css') + + @app.route('/search', methods=['GET', 'POST']) def search(): """Search query in q and return results. |