Skip to content

Saving zstd-encoded content fails. #947

@0x1b5b

Description

@0x1b5b

Describe the bug

Attempting to save zstd-encoded content in wayback results in corrupted data being served during replay.

Steps to reproduce the bug

  • Run wayback --live.
  • Open Firefox.
  • Type "http://localhost:8080/" in the address bar.
  • Press enter.
  • In the page that opens, click on the "/live" link.
  • In the URL input, enter "https://goughlui.com/" (I'm not the owner of the blog, it just seems to be one of the few web sites that use zstd).
  • Click on the "Search" button.
  • Open the first capture that appears in the calendar view.

Expected behavior

A page identical to the one available through a browser should be served.

Screenshots

Corrupted output when replaying zstd-encoded content

Environment

  • OS: Debian 12
  • Browser: Firefox
  • Version: 141.0

Additional context

In order to make sure that the issue was caused by the zstd encoding, I tried removing the zstd entry from Firefox's network.http.accept-encoding.secure setting, and this did indeed make wayback work as expected. One important thing to keep in mind is that the issue can not be reproduced when wayback is not bound to localhost. This is because Firefox will only accept zstd in a "secure" context, and since the HTTP server provided by Werkzeug does not use HTTPS, Firefox will not treat it as a "secure" context unless it is bound to localhost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions