Fixed bug with max upload size

When max upload size was not set (default 0), servefile woudn't
allow any uploads.
master
Sebastian Lohff 12 years ago
parent 4fbe543d53
commit c010709827

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

Loading…
Cancel
Save