gmid icon indicating copy to clipboard operation
gmid copied to clipboard

GG: /.. reported as invalid IRI

Open Toby222 opened this issue 3 years ago • 3 comments

Requesting the address gemini://localhost/../ returns the error gg: invalid IRI: illegal path, even though it should be a valid IRI gemini://localhost/./...../ (arbitrarily many . at the end) works, and will return the index of localhost, if requested on a gmid server

Toby222 avatar Feb 14 '22 12:02 Toby222

good catch, I haven't thought about that case.

gg uses the same IRI code that gmid use, and so it performs some cleanups that are needed server-side but not on the client.

I had in mind to improve the IRI handling and separate the parsing and cleanup phases, now I have a strong reason to do that :)

omar-polo avatar Feb 14 '22 12:02 omar-polo

If you don't mind, I'd keep this open. While it's not a top-priority, I still like to to eventually fix it ^^"

omar-polo avatar Oct 12 '23 10:10 omar-polo

No problem! just went through my old stuff and removed the inactive-seeming ones

Toby222 avatar Oct 12 '23 11:10 Toby222

Took a while to fix this, oops :)

When I wrote the parser I was a bit paranoic and decided to reject altogether paths that tried to "escape" the root. However, RFC 3986 § 5.2.4 in the algorithm "remove_dot_segments" explicitly allows for it.

omar-polo avatar Jun 10 '24 16:06 omar-polo