Skip to content

Conversation

@rhenium
Copy link
Member

@rhenium rhenium commented Nov 12, 2025

URI::HTTP#authority should belong to URI::Generic since the concept of an authority isn't specific to http or https URIs: https://datatracker.ietf.org/doc/html/rfc3986#section-3.2

However, URI::Generic#authority was recently taken in commit 6c6449e, where it returns a list of subcomponents of the authority. This has made into v1.0.4 (2025-10-07).

Although it has a public visibility, it seems to have been intended for internal use, as there are no direct tests for it and no mention in the GitHub release notes. If it's not too late, I'd like to rename it to something else. In this PR, I've renamed it to "authority_components".

This PR also fixes URI::HTTP#authority (now URI::Generic#authority) skipping the userinfo part.

@nobu @HoneyryderChuck What do you think?

Do not use #authority here, since a web origin is defined as a triple
of (scheme, host, port), which is different from a URI authority.
Rename methods URI::Generic#authority and #set_authority added in commit
6c6449e (Add authority accessor, 2025-06-26).

The name "authority" conflicts with the existing URI::HTTP#authority
which returns the composed authority component rather than an array of
subcomponents.
The concept of authority is not specific to http/https URIs, so
URI::Generic is more appropriate place for this method.

This also fixes the missing userinfo part in the authority.
@HoneyryderChuck
Copy link
Contributor

+1. I initially added it as part of adding #origin, and my understanding was that an origin was a purely http url concept, and applied the same judgement to #authority. Your link to the RFC corrects me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants