aboutsummaryrefslogtreecommitdiff
path: root/server.py
diff options
context:
space:
mode:
authorAnthony Wang2023-01-18 19:52:31 +0000
committerAnthony Wang2023-01-18 19:52:31 +0000
commitbaedc9903c3271ab9c384c07c4626626c80599eb (patch)
treebd79e3b036547a2edbfe06b82e00677a4190f841 /server.py
parent9f26679907730a504e65d62a7a83645a294ebf0b (diff)
Server bug fixes
Diffstat (limited to 'server.py')
-rw-r--r--server.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/server.py b/server.py
index 27f36b0..f690e22 100644
--- a/server.py
+++ b/server.py
@@ -89,10 +89,10 @@ class fuwuqi(SimpleHTTPRequestHandler):
# Make sure activity doer matches HTTP signature
actor = keyid.removesuffix('#main-key')
- if ('actor' in activity and activity['actor'] != actor) or
- ('attributedTo' in activity and activity['attributedTo'] != actor) or
- ('actor' in activity['object'] and activity['object']['actor'] != actor) or
- ('attributedTo' in activity['object'] and activity['object']['attributedTo'] != actor)
+ if ('actor' in activity and activity['actor'] != actor) or \
+ ('attributedTo' in activity and activity['attributedTo'] != actor) or \
+ ('actor' in activity['object'] and activity['object']['actor'] != actor) or \
+ ('attributedTo' in activity['object'] and activity['object']['attributedTo'] != actor):
self.send_response(401)
return
@@ -104,7 +104,7 @@ class fuwuqi(SimpleHTTPRequestHandler):
collection_append(f'users/{username}.outbox', activity)
# Clients responsible for addressing activity
for to in activity['to']:
- if 'followers' in to or to 'https://www.w3.org/ns/activitystreams#Public':
+ if 'followers' in to or to == 'https://www.w3.org/ns/activitystreams#Public':
with open(f'users/{username}.followers') as f:
for follower in load(f)['orderedItems']:
send(follower, self.headers, body)