whitelist_ratelimiter: @dalf patch

- it calls ip_address and ip_network only once for the settings.
- init_whitelist to make tests easier
- get_remote_addr get the IP address for the function is_accepted_request
- for reference: https://esd.io/blog/flask-apps-heroku-real-ip-spoofing.html
This commit is contained in:
blob42 2023-05-18 20:46:52 +02:00
parent 04121beb10
commit 6122afdd98
4 changed files with 52 additions and 28 deletions

1
manage
View file

@ -698,6 +698,7 @@ test.pylint() {
build_msg TEST "[pylint] searx tests"
python ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \
--disable="${PYLINT_SEARXNG_DISABLE_OPTION}" \
--additional-builtins="${PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES}" \
--ignore=searx/engines \
searx tests
)