Maximum length of profile data

master
Bob Mottram 2019-08-26 20:43:52 +01:00
parent 91a66a6972
commit cdb5949b78
1 changed files with 6 additions and 0 deletions

View File

@ -2130,6 +2130,11 @@ class PubServer(BaseHTTPRequestHandler):
self.server.POSTbusy=False
return
length = int(self.headers['Content-length'])
if length>self.server.maxProfileDataLength:
print('Maximum profile data length exceeded '+str(length))
self._redirect_headers(actorStr,cookie)
self.server.POSTbusy=False
return
postBytes=self.rfile.read(length)
msg = email.parser.BytesParser().parsebytes(postBytes)
messageFields=msg.get_payload(decode=False).split(boundary)
@ -3121,6 +3126,7 @@ def runDaemon(projectVersion, \
httpd.maxQueueLength=16
httpd.ocapAlways=ocapAlways
httpd.maxMessageLength=5000
httpd.maxProfileDataLength=3*1024*1024
httpd.maxImageSize=10*1024*1024
httpd.allowDeletion=allowDeletion
httpd.lastLoginTime=0