mirror of https://gitlab.com/bashrc2/epicyon
Check for invalid ciphertext later
parent
d98e68be5b
commit
442c4f4daa
|
@ -242,7 +242,6 @@ from like import updateLikesCollection
|
||||||
from reaction import updateReactionCollection
|
from reaction import updateReactionCollection
|
||||||
from utils import undoReactionCollectionEntry
|
from utils import undoReactionCollectionEntry
|
||||||
from utils import getNewPostEndpoints
|
from utils import getNewPostEndpoints
|
||||||
from utils import malformedCiphertext
|
|
||||||
from utils import hasActor
|
from utils import hasActor
|
||||||
from utils import setReplyIntervalHours
|
from utils import setReplyIntervalHours
|
||||||
from utils import canReplyTo
|
from utils import canReplyTo
|
||||||
|
@ -1503,11 +1502,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# save the json for later queue processing
|
# save the json for later queue processing
|
||||||
messageBytesDecoded = messageBytes.decode('utf-8')
|
messageBytesDecoded = messageBytes.decode('utf-8')
|
||||||
|
|
||||||
if malformedCiphertext(messageBytesDecoded):
|
|
||||||
print('WARN: post contains malformed ciphertext ' +
|
|
||||||
str(originalMessageJson))
|
|
||||||
return 4
|
|
||||||
|
|
||||||
if containsInvalidLocalLinks(messageBytesDecoded):
|
if containsInvalidLocalLinks(messageBytesDecoded):
|
||||||
print('WARN: post contains invalid local links ' +
|
print('WARN: post contains invalid local links ' +
|
||||||
str(originalMessageJson))
|
str(originalMessageJson))
|
||||||
|
|
4
inbox.py
4
inbox.py
|
@ -17,6 +17,7 @@ from languages import understoodPostLanguage
|
||||||
from like import updateLikesCollection
|
from like import updateLikesCollection
|
||||||
from reaction import updateReactionCollection
|
from reaction import updateReactionCollection
|
||||||
from reaction import validEmojiContent
|
from reaction import validEmojiContent
|
||||||
|
from utils import malformedCiphertext
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import fileLastModified
|
from utils import fileLastModified
|
||||||
from utils import hasObjectString
|
from utils import hasObjectString
|
||||||
|
@ -2258,6 +2259,9 @@ def _validPostContent(baseDir: str, nickname: str, domain: str,
|
||||||
print('REJECT: reply to post which does not ' +
|
print('REJECT: reply to post which does not ' +
|
||||||
'allow comments: ' + originalPostId)
|
'allow comments: ' + originalPostId)
|
||||||
return False
|
return False
|
||||||
|
if malformedCiphertext(messageJson['object']['content']):
|
||||||
|
print('REJECT: malformed ciphertext in content')
|
||||||
|
return False
|
||||||
if debug:
|
if debug:
|
||||||
print('ACCEPT: post content is valid')
|
print('ACCEPT: post content is valid')
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue