mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
html response logging
This commit is contained in:
parent
cbd68f8fd8
commit
0c493549e3
1 changed files with 3 additions and 2 deletions
|
@ -92,7 +92,7 @@ def post_request(uri: str, body: dict | None, private_key: str, key_id: str, con
|
|||
body['@context'] = default_context()
|
||||
type = body['type'] if 'type' in body else ''
|
||||
log = ActivityPubLog(direction='out', activity_type=type, result='processing', activity_id=body['id'], exception_message='')
|
||||
log.activity_json=json.dumps(body)
|
||||
log.activity_json = json.dumps(body)
|
||||
db.session.add(log)
|
||||
db.session.commit()
|
||||
|
||||
|
@ -107,7 +107,8 @@ def post_request(uri: str, body: dict | None, private_key: str, key_id: str, con
|
|||
log.exception_message = f'{result.status_code}: {result.text:.100}' + ' - '
|
||||
if 'DOCTYPE html' in result.text:
|
||||
log.result = 'ignored'
|
||||
log.exception_message = f'{result.status_code}: HTML instead of JSON response - '
|
||||
log.exception_message = f'{result.status_code}: HTML instead of JSON response - '
|
||||
log.activity_json += result.text
|
||||
elif 'community_has_no_followers' in result.text:
|
||||
fix_local_community_membership(uri, private_key)
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue