curl / trurl

a command line tool for URL parsing and manipulation.
https://curl.se/trurl/
Other
3.19k stars 101 forks source link

trurl works on urls ... what about URIs ? #372

Closed JimFuller-RedHat closed 4 weeks ago

JimFuller-RedHat commented 2 months ago

not trolling - just curious about opinions on this.

bagder commented 2 months ago

How do you define the difference?

JimFuller-RedHat commented 2 months ago

to take a more concrete use case, consider pURL (https://github.com/package-url/purl-spec)

> trurl pkg:bitbucket/birkenfeld/pygments-main@244fd47e07d1014f0aed9c

gives us

trurl note: Port number was not a decimal number between 0 and 65535 [pkg:bitbucket/birkenfeld/pygments-main@244fd47e07d1014f0aed9c]
bagder commented 2 months ago

URL/URI schemes that do not use :// are not supported by trurl because the libcurl URL API does not support those.

I don't think it is completely unthinkable that non-hierarchical schemes could be supported as well in a future, but doing that also opens up a can of worms do deal with.

jacobmealey commented 2 months ago

I don't think it is completely unthinkable that non-hierarchical schemes could be supported as well in a future, but doing that also opens up a can of worms do deal with.

This reminds me of a previous conversation had on a pr (#278) where pulling out the url API into its own library was suggested. That PR was focused around security and sandboxing, but I think this is a another potential use case.

bagder commented 4 weeks ago

A challenge with other URI schemes than :// based ones is also the naming of the URL components, which then also might need some reconsideration. If someone is eager to work on this, I think it would be a good idea to start in that end and write up a kind of "specification" for this first.

I am personally not too eager on working on this.