Fixed bug with max upload size

When max upload size was not set (default 0), servefile woudn't
allow any uploads.
This commit is contained in:
Sebastian Lohff 2012-04-26 14:52:25 +02:00
parent 4fbe543d53
commit c010709827
1 changed files with 1 additions and 1 deletions

View File

@ -225,7 +225,7 @@ class FilePutter(BaseHTTPServer.BaseHTTPRequestHandler):
if length <= 0:
self.sendResponse(411, "Content-Length was invalid or not set.")
return -1
if length > self.maxUploadSize:
if self.maxUploadSize > 0 and length > self.maxUploadSize:
self.sendResponse(413, "Your file was too big! Maximum allowed size is %d byte. <a href=\"/\">back</a>" % self.maxUploadSize)
return -1
return length