Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure CDX status is a string #739

Merged
merged 1 commit into from
Aug 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pywb/warcserver/index/cdxobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ def __le__(self, other):

@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


#=================================================================
Expand Down