Skip to content

Relative parent links can traverse outside of root-dir #1953

@katrinafyi

Description

@katrinafyi

If I have a link inside a.md like

[a](/../../../b.html)

and run lychee with root-dir, then lychee will search for b.html outside of root-dir

$ pwd
/home/x/progs/lychee
$ cargo  run -- a.md --root-dir . --dump
file:///home/b.html

This is probably not a big deal, but it is a difference between --root-dir and being hosted at the root of a website domain.

For instance, a link /../../../b.html from a page at https://example.com/a.html would resolve to https://example.com/b.html. In local files, this would correspond to /home/x/progs/lychee/b.html rather than /home/b.html.

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