honor bandwidth limit while sending previews
This commit is contained in:
parent
5a5b5baf7b
commit
7d27c4f3a1
1 changed files with 3 additions and 3 deletions
|
@ -137,10 +137,10 @@ class Handler(http.server.SimpleHTTPRequestHandler):
|
||||||
self.send_response(404, 'Not Found')
|
self.send_response(404, 'Not Found')
|
||||||
self.send_header('Content-type', 'text/plain')
|
self.send_header('Content-type', 'text/plain')
|
||||||
data = b'404 - Not Found'
|
data = b'404 - Not Found'
|
||||||
self.send_header('Content-Length', str(len(data)))
|
content_length = len(data)
|
||||||
|
self.send_header('Content-Length', str(content_length))
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
# FIXME: also check for limit here
|
self.write_with_limit(data, content_length)
|
||||||
self.wfile.write(data)
|
|
||||||
return
|
return
|
||||||
file = item.models.File.get(id)
|
file = item.models.File.get(id)
|
||||||
if not file:
|
if not file:
|
||||||
|
|
Loading…
Reference in a new issue