From b6cafb08b3e243c4d816adc24b28700ef616217d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Feb 2016 21:33:43 +0530 Subject: [PATCH] Dont leak timezone information in gzip comp[ressed streams --- src/calibre/srv/http_response.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/calibre/srv/http_response.py b/src/calibre/srv/http_response.py index 4e886c9f4f..e60249a058 100644 --- a/src/calibre/srv/http_response.py +++ b/src/calibre/srv/http_response.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2015, Kovid Goyal ' -import os, httplib, hashlib, uuid, time, struct, repr as reprlib +import os, httplib, hashlib, uuid, struct, repr as reprlib from collections import namedtuple from io import BytesIO, DEFAULT_BUFFER_SIZE from itertools import chain, repeat, izip_longest @@ -138,16 +138,14 @@ def get_ranges(headervalue, content_length): # {{{ # }}} # gzip transfer encoding {{{ -def gzip_prefix(mtime=None): +def gzip_prefix(): # See http://www.gzip.org/zlib/rfc-gzip.html - if mtime is None: - mtime = time.time() return b''.join(( b'\x1f\x8b', # ID1 and ID2: gzip marker b'\x08', # CM: compression method b'\x00', # FLG: none set - # MTIME: 4 bytes - struct.pack(b"