forked from MarseyWorld/MarseyWorld
exempt localhost from size restrictions
parent
c99dc358cb
commit
ade05ae2bc
|
@ -523,6 +523,8 @@ else patron = 'patron'
|
|||
function check_file_size(input, file) {
|
||||
if (!file) return false
|
||||
|
||||
if (location.host == 'localhost') return true
|
||||
|
||||
let max_size
|
||||
let max_size_patron
|
||||
let type
|
||||
|
|
|
@ -171,7 +171,7 @@ def process_video(file, v):
|
|||
file.save(old)
|
||||
|
||||
size = os.stat(old).st_size
|
||||
if size > MAX_VIDEO_SIZE_MB_PATRON * 1024 * 1024 or (not v.patron and size > MAX_VIDEO_SIZE_MB * 1024 * 1024):
|
||||
if not IS_LOCALHOST and (size > MAX_VIDEO_SIZE_MB_PATRON * 1024 * 1024 or (not v.patron and size > MAX_VIDEO_SIZE_MB * 1024 * 1024)):
|
||||
os.remove(old)
|
||||
stop(413, f"Max video size is {MAX_VIDEO_SIZE_MB} MB ({MAX_VIDEO_SIZE_MB_PATRON} MB for {patron}s)")
|
||||
|
||||
|
|
Loading…
Reference in New Issue