add content-encoding for precompressed deps

This commit is contained in:
ed
2019-06-26 18:26:18 +00:00
parent 9ae8bee252
commit d7bd75911d
3 changed files with 63 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ from __future__ import print_function, unicode_literals
import re
import sys
import struct
import hashlib
import threading
import subprocess as sp # nosec
@@ -416,5 +417,11 @@ def chkcmd(*argv):
return sout, serr
def gzip_orig_sz(fn):
with open(fsenc(fn), 'rb') as f:
f.seek(-4, 2)
return struct.unpack('I', f.read(4))[0]
class Pebkac(Exception):
pass