forked from Icycoide/searxng
[mod] webutils.py: remove dead code
secret_key can't be bytes (see settings_default.py)
This commit is contained in:
parent
d784870209
commit
7d4834ac4d
2 changed files with 10 additions and 15 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue