Fixed bug with max upload size

When max upload size was not set (default 0), servefile woudn't
allow any uploads.
このコミットが含まれているのは:
Sebastian Lohff 2012-04-26 14:52:25 +02:00
コミット c010709827
1個のファイルの変更1行の追加1行の削除

ファイルの表示

@ -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