RFC: Add flags to GUri to normalize parsed strings
I just wanted to start a discussion to hear if this sounds like a reasonable addition.
Currently GUri
simply takes what it is given with minimal modifications.
This becomes problematic for actual usage within a library that uses URIs
passed in by users.
URIs have a documented normal form: RFC3986
Some of the normalization steps are obvious. If you pass a path with non-ascii characters those get encoded.
Some of them require extra context that GLib doesn't have. If you pass a scheme://foo:1234
is 1234
the default port for scheme
? Do we hardcode an internal list?
Some of them are scheme specific but important enough that it should have it. Like http://foo
is normalized to the path of /
.
Thoughts on if this would be accepted in GLib are appreciated. At the moment in libsoup it means all incoming URIs have to be constantly checked to see if they are in normal form and often will be copied just to fix them. This is far from ideal and error prone.