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 self.server.POSTbusy=False
return return
length = int(self.headers['Content-length']) 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) postBytes=self.rfile.read(length)
msg = email.parser.BytesParser().parsebytes(postBytes) msg = email.parser.BytesParser().parsebytes(postBytes)
messageFields=msg.get_payload(decode=False).split(boundary) messageFields=msg.get_payload(decode=False).split(boundary)
@ -3121,6 +3126,7 @@ def runDaemon(projectVersion, \
httpd.maxQueueLength=16 httpd.maxQueueLength=16
httpd.ocapAlways=ocapAlways httpd.ocapAlways=ocapAlways
httpd.maxMessageLength=5000 httpd.maxMessageLength=5000
httpd.maxProfileDataLength=3*1024*1024
httpd.maxImageSize=10*1024*1024 httpd.maxImageSize=10*1024*1024
httpd.allowDeletion=allowDeletion httpd.allowDeletion=allowDeletion
httpd.lastLoginTime=0 httpd.lastLoginTime=0