ruby / uri

URI is a module providing classes to handle Uniform Resource Identifiers
https://ruby.github.io/uri/
Other
81 stars 43 forks source link

URI#HTTP#origin and URI#HTTP#authority #30

Closed HoneyryderChuck closed 3 years ago

HoneyryderChuck commented 3 years ago

Attempt at porting to mainline an abstraction that I've been using successfuly (as a refinement) over +3y. (ref: https://gitlab.com/honeyryderchuck/httpx/-/blob/master/lib/httpx/extensions.rb#L124-131).

authority and origin are concepts which I see reinvented (and reimplemented) in a lot of ruby HTTP infrastructure (rack, app servers like puma, net-http itself). It's usefulness is so fundamental on so many levels (connection pools by origin, check by Host header, some rack spec fields) that uri could abstract it away.

ioquatix commented 3 years ago

@HoneyryderChuck I made some cosmetic changes. Hope that's okay with you, and I'm going to merge it.

HoneyryderChuck commented 3 years ago

@ioquatix that's fine, only got time for this now, thx for jumping in :)

HoneyryderChuck commented 3 years ago

Also, just to be clear: what's the release policy for this change? Will this be synched to be released only with ruby 3.1? How will that affect the RBS signatures for the uri lib?