mirror of https://gitlab.com/bashrc2/epicyon
Different check for links within summary for person objects
parent
2d8e7dfc67
commit
9b1f5ad080
14
daemon.py
14
daemon.py
|
@ -2053,7 +2053,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return 3
|
return 3
|
||||||
# check that the summary does not contain links
|
# check that the summary does not contain links
|
||||||
if message_json['object'].get('summary'):
|
if message_json['object'].get('type') and \
|
||||||
|
message_json['object'].get('summary'):
|
||||||
|
if message_json['object']['type'] != 'Person' and \
|
||||||
|
message_json['object']['type'] != 'Application' and \
|
||||||
|
message_json['object']['type'] != 'Group':
|
||||||
if len(message_json['object']['summary']) > 1024:
|
if len(message_json['object']['summary']) > 1024:
|
||||||
print('INBOX: summary is too long ' +
|
print('INBOX: summary is too long ' +
|
||||||
message_json['actor'] + ' ' +
|
message_json['actor'] + ' ' +
|
||||||
|
@ -2068,6 +2072,14 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._400()
|
self._400()
|
||||||
self.server.postreq_busy = False
|
self.server.postreq_busy = False
|
||||||
return 3
|
return 3
|
||||||
|
else:
|
||||||
|
if len(message_json['object']['summary']) > 4096:
|
||||||
|
print('INBOX: person summary is too long ' +
|
||||||
|
message_json['actor'] + ' ' +
|
||||||
|
message_json['object']['summary'])
|
||||||
|
self._400()
|
||||||
|
self.server.postreq_busy = False
|
||||||
|
return 3
|
||||||
# if this is a local only post, is it really local?
|
# if this is a local only post, is it really local?
|
||||||
if 'localOnly' in message_json['object'] and \
|
if 'localOnly' in message_json['object'] and \
|
||||||
message_json['object'].get('to') and \
|
message_json['object'].get('to') and \
|
||||||
|
|
Loading…
Reference in New Issue