Skip to content

data: URLs rejected by latest #1980

Closed

Description

@haines

With the lycheeverse/lychee:latest-alpine image I get

[ERROR] data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC | URL is missing a host: URL missing hostname. Check URL format

With lycheeverse/lychee:0.22.0-alpine I don't get an error.

Activity

  1. added a commit that references this issue on Jan 6, 2026
  2. katrinafyi commented on Jan 6, 2026

    @katrinafyi
    Member

    bisected to f03b1c9 as first bad commit.

    i also note that there is a test dealing with data URIs, but it only tests that the URIs are detected in --dump mode. they don't check whether they are accepted by the link checker.

    after changing TryFrom<&Url> for HostKey to support data URIs, a different error is returned when it gets to

    let host_key = HostKey::try_from(uri)?;
    let host = self.get_or_create_host(host_key);
    host.get_client()
    .request(method, uri.url.clone())
    .build()
    .map_err(ErrorKind::BuildRequestClient)

    the request cannot be built for data URIs. i think data URIs shouldn't need to get up to this point, so it should be filtered out earlier in the logic. idk where, though

  3. thomas-zahner commented on Jan 14, 2026

    @thomas-zahner
    Member

    @haines Thank you very much for reporting. Otherwise this bug would most probably have been shipped with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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