From 748503121946d00763686d60078992844fb9e7bb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 27 Feb 2022 23:51:20 +0000 Subject: [PATCH] Add user agent to signed outgoing posts --- posts.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/posts.py b/posts.py index 5027c74e4..011ed5f46 100644 --- a/posts.py +++ b/posts.py @@ -2464,11 +2464,16 @@ def send_post(signing_priv_key_pem: str, project_version: str, post_path, http_prefix, with_digest, post_json_str, 'application/ld+json') + domain_full = get_full_domain(domain, port) + ua_str = 'Epicyon/' + __version__ + \ + '; +' + http_prefix + '://' + domain_full + '/' + signature_header_json['User-Agent'] = ua_str + signature_header_json_ld['User-Agent'] = ua_str + # if the "to" domain is within the shared items # federation list then send the token for this domain # so that it can request a catalog if to_domain in shared_items_federated_domains: - domain_full = get_full_domain(domain, port) if shared_item_federation_tokens.get(domain_full): signature_header_json['Origin'] = domain_full signature_header_json_ld['Origin'] = domain_full