mirror of
https://git.exozy.me/a/fuwuqi.git
synced 2024-12-01 03:11:00 +00:00
Server bug fixes
This commit is contained in:
parent
9f26679907
commit
baedc9903c
1 changed files with 5 additions and 5 deletions
10
server.py
10
server.py
|
@ -89,10 +89,10 @@ class fuwuqi(SimpleHTTPRequestHandler):
|
||||||
|
|
||||||
# Make sure activity doer matches HTTP signature
|
# Make sure activity doer matches HTTP signature
|
||||||
actor = keyid.removesuffix('#main-key')
|
actor = keyid.removesuffix('#main-key')
|
||||||
if ('actor' in activity and activity['actor'] != actor) or
|
if ('actor' in activity and activity['actor'] != actor) or \
|
||||||
('attributedTo' in activity and activity['attributedTo'] != actor) or
|
('attributedTo' in activity and activity['attributedTo'] != actor) or \
|
||||||
('actor' in activity['object'] and activity['object']['actor'] != actor) or
|
('actor' in activity['object'] and activity['object']['actor'] != actor) or \
|
||||||
('attributedTo' in activity['object'] and activity['object']['attributedTo'] != actor)
|
('attributedTo' in activity['object'] and activity['object']['attributedTo'] != actor):
|
||||||
self.send_response(401)
|
self.send_response(401)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class fuwuqi(SimpleHTTPRequestHandler):
|
||||||
collection_append(f'users/{username}.outbox', activity)
|
collection_append(f'users/{username}.outbox', activity)
|
||||||
# Clients responsible for addressing activity
|
# Clients responsible for addressing activity
|
||||||
for to in activity['to']:
|
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:
|
with open(f'users/{username}.followers') as f:
|
||||||
for follower in load(f)['orderedItems']:
|
for follower in load(f)['orderedItems']:
|
||||||
send(follower, self.headers, body)
|
send(follower, self.headers, body)
|
||||||
|
|
Loading…
Reference in a new issue