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

Relative urls ../../somewhere are broken #1259

Open
jb-- opened this issue Sep 27, 2023 · 1 comment
Open

Relative urls ../../somewhere are broken #1259

jb-- opened this issue Sep 27, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jb--
Copy link

jb-- commented Sep 27, 2023

Screenshot 2023-09-27 at 19 54 07

The page https://wowirleben.de/strassen/52062/aachen/markt has relative URLs of the pattern <a href="../../52062/aachen/jakobstrasse">Jakobstraße</a> which point in the browser to https://wowirleben.de/strassen/52062/aachen/../../52062/aachen/jakobstrasse -> i.e. https://wowirleben.de/strassen/52062/aachen/jakobstrasse.

The command lychee https://wowirleben.de/strassen/52062/aachen/markt results in the message

✗ [404] https://wowirleben.de/52062/aachen/jakobstrasse | Failed: Network error: Not Found
@mre
Copy link
Member

mre commented Sep 28, 2023

Can confirm. I tried in on the command line and get the same result; it strips away strassen, so it is one level too much in the hierarchy. To narrow it down, we could write a unit test, which tests the rewrite behavior.
Maybe something is going wrong here:

let resolved = path::resolve(src, &PathBuf::from(&*decoded), base)?;

There is just a single test in that file right now. We should add more cases anyway — also tests for edge-cases. PR welcome. 😅

@mre mre added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants