Skip to content

Creates the NormalizeAddr Func to Format IPv6 Addresses #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 6, 2025

Conversation

kheina
Copy link
Contributor

@kheina kheina commented Feb 25, 2025

NormalizeAddr takes an address as a string and returns a normalized copy. If the address is a URL, IP Address, or host:port address that includes an IPv6 address, the normalized copy will be conformant with RFC-5952 §4. If the address cannot be parsed, an error will be returned.

There are two valid formats:

  • hosts: host
    • may be any of: IPv6 literal, IPv4 literal, dns name, or [sub]domain name
    • IPv6 literals are not required to be encapsulated within square brackets
      in this format
  • URIs: [scheme://] [user@] host [:port] [/path] [?query] [#frag]
    • format should conform with RFC-3986 §3 or else the returned address may be parsed and formatted incorrectly
    • hosts containing IPv6 literals MUST be encapsulated within square brackets, as defined in RFC-3986 §3.2.2 and RFC-5952 §6
    • all non-host components are optional

See:

…copy of that address conformant with RFC5952
Copy link

@hugoghx hugoghx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a first pass 👀

@hugoghx hugoghx requested a review from louisruch February 26, 2025 16:54
jefferai
jefferai previously approved these changes Mar 6, 2025
louisruch
louisruch previously approved these changes Mar 6, 2025
Copy link
Contributor

@louisruch louisruch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this thanks!

hugoghx
hugoghx previously approved these changes Mar 6, 2025
Copy link

@hugoghx hugoghx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@kheina kheina dismissed stale reviews from hugoghx, louisruch, and jefferai via 25cf3e7 March 6, 2025 22:30
@jefferai jefferai merged commit 8565209 into main Mar 6, 2025
24 of 25 checks passed
@jefferai jefferai deleted the dani_create-NormalizeAddr-util-func branch March 6, 2025 22:34
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.

4 participants