From 5d8e975d3a5d7369db51d49472178df626e1e581 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 14 Sep 2021 14:05:10 +0100 Subject: [PATCH] Fix tests --- httpsig.py | 3 +-- posts.py | 20 ++++++++++---------- webfinger.py | 1 - 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/httpsig.py b/httpsig.py index e4ee2964a..aab29c753 100644 --- a/httpsig.py +++ b/httpsig.py @@ -210,8 +210,7 @@ def createSignedHeader(privateKeyPem: str, nickname: str, dateStr = strftime("%a, %d %b %Y %H:%M:%S %Z", gmtime()) if not withDigest: contentType = \ - 'application/activity+json, ' + \ - 'application/ld+json, application/jrd+json' + 'application/activity+json' headers = { '(request-target)': f'get {path}', 'host': headerDomain, diff --git a/posts.py b/posts.py index d06bc4c12..803465c85 100644 --- a/posts.py +++ b/posts.py @@ -509,14 +509,14 @@ def _getPosts(session, outboxUrl: str, maxPosts: int, return personPosts profileStr = 'https://www.w3.org/ns/activitystreams' acceptStr = \ - 'application/activity+json, application/ld+json; ' + \ + 'application/activity+json; ' + \ 'profile="' + profileStr + '"' asHeader = { 'Accept': acceptStr } if '/outbox/' in outboxUrl: acceptStr = \ - 'application/ld+json, application/activity+json; ' + \ + 'application/ld+json; ' + \ 'profile="' + profileStr + '"' asHeader = { 'Accept': acceptStr @@ -719,14 +719,14 @@ def getPostDomains(session, outboxUrl: str, maxPosts: int, return [] profileStr = 'https://www.w3.org/ns/activitystreams' acceptStr = \ - 'application/activity+json, application/ld+json; ' + \ + 'application/activity+json; ' + \ 'profile="' + profileStr + '"' asHeader = { 'Accept': acceptStr } if '/outbox/' in outboxUrl: acceptStr = \ - 'application/ld+json, application/activity+json; ' + \ + 'application/ld+json; ' + \ 'profile="' + profileStr + '"' asHeader = { 'Accept': acceptStr @@ -782,14 +782,14 @@ def _getPostsForBlockedDomains(baseDir: str, return {} profileStr = 'https://www.w3.org/ns/activitystreams' acceptStr = \ - 'application/activity+json, application/ld+json; ' + \ + 'application/activity+json; ' + \ 'profile="' + profileStr + '"' asHeader = { 'Accept': acceptStr } if '/outbox/' in outboxUrl: acceptStr = \ - 'application/ld+json, application/activity+json; ' + \ + 'application/ld+json; ' + \ 'profile="' + profileStr + '"' asHeader = { 'Accept': acceptStr @@ -3988,14 +3988,14 @@ def downloadFollowCollection(signingPrivateKeyPem: str, prof = 'https://www.w3.org/ns/activitystreams' if '/channel/' not in actor or '/accounts/' not in actor: acceptStr = \ - 'application/activity+json, application/ld+json; ' + \ + 'application/activity+json; ' + \ 'profile="' + prof + '"' sessionHeaders = { 'Accept': acceptStr } else: acceptStr = \ - 'application/ld+json, application/activity+json; ' + \ + 'application/ld+json; ' + \ 'profile="' + prof + '"' sessionHeaders = { 'Accept': acceptStr @@ -4344,7 +4344,7 @@ def downloadAnnounce(session, baseDir: str, httpPrefix: str, else: profileStr = 'https://www.w3.org/ns/activitystreams' acceptStr = \ - 'application/activity+json, application/ld+json; ' + \ + 'application/activity+json; ' + \ 'profile="' + profileStr + '"' asHeader = { 'Accept': acceptStr @@ -4352,7 +4352,7 @@ def downloadAnnounce(session, baseDir: str, httpPrefix: str, if '/channel/' in postJsonObject['actor'] or \ '/accounts/' in postJsonObject['actor']: acceptStr = \ - 'application/ld+json, application/activity+json; ' + \ + 'application/ld+json; ' + \ 'profile="' + profileStr + '"' asHeader = { 'Accept': acceptStr diff --git a/webfinger.py b/webfinger.py index f361cd045..3ca4f00e5 100644 --- a/webfinger.py +++ b/webfinger.py @@ -159,7 +159,6 @@ def createWebfingerEndpoint(nickname: str, domain: str, port: int, profilePageHref = httpPrefix + '://' + domain + \ '/about/more?instance_actor=true' - actor = localActorUrl(httpPrefix, nickname, domain) account = { "aliases": [ httpPrefix + "://" + domain + "/@" + personName,