From 8ff0ec61143be37bc8494a5ebf744fb60563f480 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 16 Oct 2023 10:48:57 +0100 Subject: [PATCH] Allow inbox url domain to differ from instance domain when sending signed json A workaround for wordpress --- posts.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/posts.py b/posts.py index 775a4592d..eac635003 100644 --- a/posts.py +++ b/posts.py @@ -3229,6 +3229,17 @@ def send_signed_json(post_json_object: {}, session, base_dir: str, ' in ' + base_dir + '/keys/private') return 6 + # NOTE: the inbox domain being sent to isn't always the same + # as the destination instance domain. eg public-api.wordpress.com + # rather than the wordpress instance domain + inbox_url_domain, _ = get_domain_from_actor(inbox_url) + if inbox_url_domain: + if inbox_url_domain != to_domain: + print('send_signed_json ' + + 'inbox domain is not the same as instance domain ' + + inbox_url_domain + ' != ' + to_domain) + to_domain = inbox_url_domain + if to_domain not in inbox_url: if debug: print('DEBUG: send_signed_json ' +