diff --git a/README.md b/README.md index ffb727ce..58e7fe73 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ server { root /var/www/YOUR_DOMAIN/htdocs; access_log /dev/null; error_log /dev/null; - client_max_body_size 20m; + client_max_body_size 31m; client_body_buffer_size 128k; limit_conn conn_limit_per_ip 10; @@ -135,7 +135,7 @@ server { location / { proxy_http_version 1.1; - client_max_body_size 11M; + client_max_body_size 31M; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; diff --git a/daemon.py b/daemon.py index cbed9fd8..02f6df10 100644 --- a/daemon.py +++ b/daemon.py @@ -2987,7 +2987,9 @@ class PubServer(BaseHTTPRequestHandler): length = int(self.headers['Content-length']) if self.server.debug: print('DEBUG: content-length: '+str(length)) - if not self.headers['Content-type'].startswith('image/'): + if not self.headers['Content-type'].startswith('image/') and \ + not self.headers['Content-type'].startswith('video/') and \ + not self.headers['Content-type'].startswith('audio/'): if length>self.server.maxMessageLength: print('Maximum message length exceeded '+str(length)) self.send_response(400) @@ -2995,8 +2997,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.POSTbusy=False return else: - if length>self.server.maxImageSize: - print('Maximum image size exceeded '+str(length)) + if length>self.server.maxMediaSize: + print('Maximum media size exceeded '+str(length)) self.send_response(400) self.end_headers() self.server.POSTbusy=False @@ -3193,7 +3195,9 @@ def runDaemon(projectVersion, \ httpd = ThreadingHTTPServer(serverAddress, PubServer) # max POST size of 10M httpd.projectVersion=projectVersion - httpd.maxPostLength=1024*1024*10 + httpd.maxPostLength=1024*1024*30 + httpd.maxMediaSize=httpd.maxPostLength + httpd.maxMessageLength=5000 httpd.maxPostsInBox=256 httpd.domain=domain httpd.port=port @@ -3222,8 +3226,6 @@ def runDaemon(projectVersion, \ httpd.postLog=[] httpd.maxQueueLength=16 httpd.ocapAlways=ocapAlways - httpd.maxMessageLength=5000 - httpd.maxImageSize=10*1024*1024 httpd.allowDeletion=allowDeletion httpd.lastLoginTime=0 httpd.maxReplies=maxReplies