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

Not removing dot segments when resolving relative URLs #47

Open
acidus99 opened this issue Aug 22, 2023 · 1 comment
Open

Not removing dot segments when resolving relative URLs #47

acidus99 opened this issue Aug 22, 2023 · 1 comment

Comments

@acidus99
Copy link

acidus99 commented Aug 22, 2023

Buran 1.12 is not properly resolving relative URLs. Specifically, Buran is not removing "dot segments" (e.g. ../ or ./) which is required by RFC 3986 when resolving URLs.

Look at this URL:
gemini://rawtext.club/~winter/gemlog/2023/8-18.gmi

At the bottom of the page there is a link line:

=> .. gemlog

This relative URL should be resolved to the fully qualified URL gemini://rawtext.club/~winter/gemlog/, which should then be sent in the Gemini request. Instead, it Buran sends the URL gemini://rawtext.club/~winter/gemlog/2023/.. in the request. While some servers may handle that URL, most don't, including that capsule, which returns a 50 server error saying it's a bad request.

When resolving relative URLs, you should use the algorithm described in section 5.2 of RFC 3986, specifically section 5.2.4: Remove Dot Segments. Most URL libraries do this automatically when parsing/resolving URLs. Perhaps Buran is using an out-of-date library, or not using a proper URL parsing library.

@ProjectMoon
Copy link

My server (Agate) seems to handle this, but it causes weird link loops. As I have documents nested a few levels deep, Buran cannot properly go all the way back up the tree when I am clicking through a bunch of .. links.

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

No branches or pull requests

2 participants