summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-12-28 10:14:38 +0100
committerAlexandre Flament <alex@al-f.net>2021-12-28 10:14:38 +0100
commit7d4834ac4dd708b87187caff8eb59e783e8c2111 (patch)
treef3a27c9cc2feaa9f0ac83fad80f176e9bdb63639 /searx
parentd7848702097ca6a3e8630ca6d46210abf7314673 (diff)
downloadsearxng-7d4834ac4dd708b87187caff8eb59e783e8c2111.tar.gz
searxng-7d4834ac4dd708b87187caff8eb59e783e8c2111.zip
[mod] webutils.py: remove dead code
secret_key can't be bytes (see settings_default.py)
Diffstat (limited to 'searx')
-rw-r--r--searx/webutils.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/searx/webutils.py b/searx/webutils.py
index 737e5a82f..11a101806 100644
--- a/searx/webutils.py
+++ b/searx/webutils.py
@@ -77,14 +77,7 @@ def get_result_templates(templates_path):
def new_hmac(secret_key, url):
- try:
- secret_key_bytes = bytes(secret_key, 'utf-8')
- except TypeError as err:
- if isinstance(secret_key, bytes):
- secret_key_bytes = secret_key
- else:
- raise err
- return hmac.new(secret_key_bytes, url, hashlib.sha256).hexdigest()
+ return hmac.new(secret_key.encode(), url, hashlib.sha256).hexdigest()
def prettify_url(url, max_length=74):