mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 11:01:12 +00:00
Merge pull request #3434 from hughrun/signed_requests
sign all AP requests
This commit is contained in:
commit
1923db31b1
1 changed files with 3 additions and 7 deletions
|
@ -369,16 +369,12 @@ def resolve_remote_id(
|
||||||
|
|
||||||
# load the data and create the object
|
# load the data and create the object
|
||||||
try:
|
try:
|
||||||
data = get_data(remote_id)
|
data = get_activitypub_data(remote_id)
|
||||||
except ConnectionError:
|
except ConnectionError:
|
||||||
logger.info("Could not connect to host for remote_id: %s", remote_id)
|
logger.info("Could not connect to host for remote_id: %s", remote_id)
|
||||||
return None
|
return None
|
||||||
except requests.HTTPError as e:
|
except requests.HTTPError as e:
|
||||||
if (e.response is not None) and e.response.status_code == 401:
|
logger.exception("HTTP error - remote_id: %s - error: %s", remote_id, e)
|
||||||
# This most likely means it's a mastodon with secure fetch enabled.
|
|
||||||
data = get_activitypub_data(remote_id)
|
|
||||||
else:
|
|
||||||
logger.info("Could not connect to host for remote_id: %s", remote_id)
|
|
||||||
return None
|
return None
|
||||||
# determine the model implicitly, if not provided
|
# determine the model implicitly, if not provided
|
||||||
# or if it's a model with subclasses like Status, check again
|
# or if it's a model with subclasses like Status, check again
|
||||||
|
|
Loading…
Reference in a new issue