mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
Ensure CDX status is a string (#739)
If a CDXJ entry has a status that is an int that can cause problems in multiple places in pywb. This change ensures that int status lines are converted to str.
This commit is contained in:
parent
4f1a6303fa
commit
a97ad7ebbe
@ -251,7 +251,11 @@ class CDXObject(OrderedDict):
|
||||
|
||||
@classmethod
|
||||
def json_decode(cls, string):
|
||||
return json_decode(string, object_pairs_hook=OrderedDict)
|
||||
cdx_block = json_decode(string, object_pairs_hook=OrderedDict)
|
||||
# other parts of pywb expect status to be a string and not an integer
|
||||
if cdx_block and type(cdx_block.get('status')) == int:
|
||||
cdx_block['status'] = str(cdx_block['status'])
|
||||
return cdx_block
|
||||
|
||||
|
||||
#=================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user