url.h icon indicating copy to clipboard operation
url.h copied to clipboard

Change member ownership

Open RokerHRO opened this issue 1 year ago • 4 comments

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 avatar Dec 05 '23 09:12 RokerHRO

@RokerHRO very nice work! let me know when you are ready for review!

jwerle avatar Dec 15 '23 11:12 jwerle

@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.

RokerHRO avatar Dec 15 '23 11:12 RokerHRO

@jwerle : I'd say it is ready for review now. :-)

RokerHRO avatar Dec 27 '23 15:12 RokerHRO

The version number should be bumped, because my rewrite results in incompatible API change. ;-)

RokerHRO avatar Jan 07 '24 19:01 RokerHRO

@jwerle : are you still active and interested in this project?

RokerHRO avatar Jun 09 '24 15:06 RokerHRO

@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!

jwerle avatar Jun 14 '24 11:06 jwerle