mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
4cd7ff3968
commit
8952b8251e
@ -76,7 +76,7 @@ class FileSystemOutputFile(object):
|
||||
pos = output.tell()
|
||||
output.seek(0, os.SEEK_END)
|
||||
self.content_length = output.tell() - pos
|
||||
self.etag = hashlib.sha1(type('')(os.fstat(output.fileno()).st_mtime) + force_unicode(output.name or '')).hexdigest()
|
||||
self.etag = '"%s"' % hashlib.sha1(type('')(os.fstat(output.fileno()).st_mtime) + force_unicode(output.name or '')).hexdigest()
|
||||
output.seek(pos)
|
||||
self.accept_ranges = True
|
||||
|
||||
@ -125,7 +125,7 @@ class StaticGeneratedOutput(object):
|
||||
|
||||
def __init__(self, data):
|
||||
self.data = data
|
||||
self.etag = hashlib.sha1(data).hexdigest()
|
||||
self.etag = '"%s"' % hashlib.sha1(data).hexdigest()
|
||||
self.content_length = len(data)
|
||||
self.accept_ranges = False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user