streamer improvement, issue 884, thanks Niphlod
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.0 (2012-07-12 11:26:41) dev
|
Version 2.00.0 (2012-07-12 14:05:01) dev
|
||||||
|
|||||||
+4
-4
@@ -62,10 +62,10 @@ def stream_file_or_304_or_206(
|
|||||||
fsize = stat_file[stat.ST_SIZE]
|
fsize = stat_file[stat.ST_SIZE]
|
||||||
mtime = time.strftime('%a, %d %b %Y %H:%M:%S GMT',
|
mtime = time.strftime('%a, %d %b %Y %H:%M:%S GMT',
|
||||||
time.gmtime(stat_file[stat.ST_MTIME]))
|
time.gmtime(stat_file[stat.ST_MTIME]))
|
||||||
headers['Content-Type'] = contenttype(static_file)
|
headers.setdefault('Content-Type', contenttype(static_file))
|
||||||
headers['Last-Modified'] = mtime
|
headers.setdefault('Last-Modified', mtime)
|
||||||
headers['Pragma'] = 'cache'
|
headers.setdefault('Pragma', 'cache')
|
||||||
headers['Cache-Control'] = 'private'
|
headers.setdefault('Cache-Control', 'private')
|
||||||
|
|
||||||
if request and request.env.http_if_modified_since == mtime:
|
if request and request.env.http_if_modified_since == mtime:
|
||||||
raise HTTP(304, **{'Content-Type': headers['Content-Type']})
|
raise HTTP(304, **{'Content-Type': headers['Content-Type']})
|
||||||
|
|||||||
Reference in New Issue
Block a user