File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -811,15 +811,16 @@ def _extract_headers_from_download(self, response):
811811 # 'X-Goog-Hash': 'crc32c=4gcgLQ==,md5=CS9tHYTtyFntzj7B9nkkJQ==',
812812 x_goog_hash = response .headers .get ("X-Goog-Hash" , "" )
813813
814- digests = {}
815- for encoded_digest in x_goog_hash .split ("," ):
816- match = re .match (r"(crc32c|md5)=([\w\d/]+={0,3})" , encoded_digest )
817- if match :
818- method , digest = match .groups ()
819- digests [method ] = digest
820-
821- self .crc32c = digests .get ("crc32c" , self .crc32c )
822- self .md5_hash = digests .get ("md5" , self .md5_hash )
814+ if x_goog_hash :
815+ digests = {}
816+ for encoded_digest in x_goog_hash .split ("," ):
817+ match = re .match (r"(crc32c|md5)=([\w\d/\+/]+={0,3})" , encoded_digest )
818+ if match :
819+ method , digest = match .groups ()
820+ digests [method ] = digest
821+
822+ self .crc32c = digests .get ("crc32c" , None )
823+ self .md5_hash = digests .get ("md5" , None )
823824
824825 def _do_download (
825826 self ,
You can’t perform that action at this time.
0 commit comments