Skip to content

Fix issue #947 #948

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix issue #947 #948

wants to merge 3 commits into from

Conversation

0x1b5b
Copy link

@0x1b5b 0x1b5b commented Jul 23, 2025

Description

This pull request fixes issue #947. Since warcio appears to be lacking support for zstd at the moment, I have decided to remove zstd from the Accept-Encoding HTTP header's value. This is similar to the patch that was provided in pull request #444 as a solution to issue #434.

Motivation and Context

See issue #947.

Screenshots (if appropriate):

goughlui.com being served in wayback

Compare this screenshot to the one provided in issue #947.

Types of changes

  • Replay fix (fixes a replay specific issue)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added or updated tests to cover my changes. (I could not find existing tests for this code path, so I decided not to add any new tests.)
  • All new and existing tests passed. (They do not seem to pass even without my changes.)

# if brotli not available, remove 'br' from accept-encoding to avoid
# capture brotli encoded content
# We have to remove zstd from the list of accepted encodings as warcio does not support it.
disallowed_encodings = ('zstd') if has_brotli else ('zstd', 'br')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a comma:

Suggested change
disallowed_encodings = ('zstd') if has_brotli else ('zstd', 'br')
disallowed_encodings = ('zstd',) if has_brotli else ('zstd', 'br')

Otherwise if has_brotli is true, then disallowed_encodings is the string "zstd" not a tuple which means the not in disallowed_encodings is checking for any substring of 'zstd'.

>>> 'z' not in ('zstd')
False
>>> 'z' not in ('zstd',)
True

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants