url.h
url.h copied to clipboard
Change member ownership
I've implemented my ideas für #11 in a separate branch in my forked repo.
Please consider this merge request as "request for comments" on my changes:
- only one "owning" string member, the other members are non-owning and just point to certain parts of the (processed) URL.
- rename API functions to use the official names for the parts of a URL:
- protocol -> scheme
- hash -> fragment
- remove the functions / members with unclear semantics
- path vs. pathname
- host vs. hostname
- query vs. search
- document which members might be
NULL
- add support for IPv6 literals in hostname
Features still missing but shall come in future:
- decode percend-encoded octets (%xx)
- parse query string into list of name-value pairs
- (maybe) IDN support
- correct path parser, incl. path normalization ("/foo/../bar/./yuk" -> "/bar/yuk")
@RokerHRO very nice work! let me know when you are ready for review!
@RokerHRO very nice work! let me know when you are ready for review!
Thank you!
You can already review and comment the changes I made! :-)
What I'd still like to add is parsing the query string (incl. %-decoding) into an array (or linked list? what would you prefer?) of key-value pairs and adding access function for that.
@jwerle : I'd say it is ready for review now. :-)
The version number should be bumped, because my rewrite results in incompatible API change. ;-)
@jwerle : are you still active and interested in this project?
@jwerle : are you still active and interested in this project?
I am interested, but not active on it. Just merged. Feel free to take lead on this!