|
@@ -47,6 +47,8 @@ def validate(filename: str, tool: str, root='rest/static/files') -> bytes:
|
|
ret = static_file('/'.join([filename,]*2) + '.file', root=root)
|
|
ret = static_file('/'.join([filename,]*2) + '.file', root=root)
|
|
if isinstance(ret, HTTPError):
|
|
if isinstance(ret, HTTPError):
|
|
return abort(404, f"No such `{tool.title()}`: {filename}")
|
|
return abort(404, f"No such `{tool.title()}`: {filename}")
|
|
|
|
+ if ret.status_code == 304:
|
|
|
|
+ return ret
|
|
|
|
|
|
if ret.content_length > CLIP_SIZE_LIMIT:
|
|
if ret.content_length > CLIP_SIZE_LIMIT:
|
|
return abort(418, f"{tool.title()} size exceeds {CLIP_SIZE_LIMIT}")
|
|
return abort(418, f"{tool.title()} size exceeds {CLIP_SIZE_LIMIT}")
|