Fix algorithm reference

This commit is contained in:
Valentin 2022-12-24 22:41:32 +01:00
parent 6a0c1fe726
commit acd38ce9f7
No known key found for this signature in database
GPG key ID: AA2F52BADD7EF624

View file

@ -3,7 +3,7 @@ import traceback
from aiohttp import ClientSession, ClientTimeout, TCPConnector
from aiohttp.client_exceptions import ClientConnectorError, ServerTimeoutError
from aputils import Nodeinfo, WellKnownNodeinfo
from aputils import Nodeinfo, WellKnownNodeinfo, AlgorithmType
from datetime import datetime
from cachetools import LRUCache
from json.decoder import JSONDecodeError
@ -141,10 +141,10 @@ class HttpClient:
# Using the old algo by default is probably a better idea right now
if (instance and instance.get('software') in {'mastodon'}) or (software and software in {'mastodon'}):
algorithm = 'hs2019'
algorithm = AlgorithmType.HS2019
else:
algorithm = 'original'
algorithm = AlgorithmType.ORIGINAL
headers = {'Content-Type': 'application/activity+json'}
headers.update(self.database.signer.sign_headers(