mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
Drop unnecessary split for newline in CDX results
This commit is contained in:
parent
f6b1d6f408
commit
4282032772
@ -223,9 +223,9 @@ class CdxServerDedup(object):
|
|||||||
else:
|
else:
|
||||||
dkey = digest_key.encode('utf-8')
|
dkey = digest_key.encode('utf-8')
|
||||||
dkey = dkey[5:] if dkey.startswith(b'sha1:') else dkey
|
dkey = dkey[5:] if dkey.startswith(b'sha1:') else dkey
|
||||||
line = result.data.split(b'\n')
|
line = result.data.strip()
|
||||||
if line:
|
if line:
|
||||||
(cdx_ts, cdx_digest) = line[0].split(b' ')
|
(cdx_ts, cdx_digest) = line.split(b' ')
|
||||||
if cdx_digest == dkey:
|
if cdx_digest == dkey:
|
||||||
dt = datetime.strptime(cdx_ts.decode('ascii'),
|
dt = datetime.strptime(cdx_ts.decode('ascii'),
|
||||||
'%Y%m%d%H%M%S')
|
'%Y%m%d%H%M%S')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user