From c010709827d61871a804632443f0cc570d35b645 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Thu, 26 Apr 2012 14:52:25 +0200 Subject: [PATCH] Fixed bug with max upload size When max upload size was not set (default 0), servefile woudn't allow any uploads. --- servefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servefile b/servefile index 9fa1779..f76c438 100755 --- a/servefile +++ b/servefile @@ -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. back" % self.maxUploadSize) return -1 return length