Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[mod] py: cleanup link_token.py

Ivan Gabaldonf25b75e61375
diff --git a/searx/botdetection/link_token.py b/searx/botdetection/link_token.py
index a74b2eaa4..ff67d6fb1 100644
--- a/searx/botdetection/link_token.py
+++ b/searx/botdetection/link_token.py
@@ -151,6 +151,6 @@ def get_token() -> str:
if token:
token = token.decode('UTF-8') # type: ignore
else:
- token = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(16))
+ token = ''.join(random.choices(string.ascii_lowercase + string.digits, k=16))
valkey_client.set(TOKEN_KEY, token, ex=TOKEN_LIVE_TIME)
return token