Skip to content

Support HTTPS and IDNA domains; bump edition/version; add CI and tests#3

Closed
code-tc wants to merge 3 commits into
mainfrom
codex/add-https-and-domain-name-support
Closed

Support HTTPS and IDNA domains; bump edition/version; add CI and tests#3
code-tc wants to merge 3 commits into
mainfrom
codex/add-https-and-domain-name-support

Conversation

@code-tc

@code-tc code-tc commented May 6, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Add HTTPS protocol support and proper handling of internationalized domain names to allow parsing and normalization of a wider set of URLs.
  • Modernize the crate by bumping the Rust edition and package version and by updating a few dependency versions.
  • Introduce CI to run unit tests on push and pull requests to ensure continued correctness across features.

Description

  • Add Protocol::HTTPS, accept https:// in Host/Link parsing, and update Protocol ordering and display to include https.
  • Introduce Address::Domain and use idna::domain_to_ascii to validate/normalize domain names, updating Address ordering, GetSize, as_ip, and is_localhost accordingly.
  • Change parsing logic in Host::from_str to detect protocol (http vs https) and to distinguish IPv4/IPv6 vs domain names, returning normalized ASCII domains when applicable.
  • Bump package version to 0.5.0, edition to 2024, adjust dependency entries (destream, hr-id, add idna), and add a GitHub Actions workflow at .github/workflows/ci.yml that runs cargo test for default and --all-features.
  • Add unit tests for parsing Host/Link (including IDN normalization and invalid domain handling) and small compile-time tests asserting serde/destream impl availability in src/lib.rs, src/serial.rs, and src/stream.rs.

Testing

  • Ran cargo test --verbose to execute unit tests with default features, and the test suite completed successfully.
  • Ran cargo test --all-features --verbose to validate behavior with optional features enabled, and the test suite completed successfully.
  • GitHub Actions CI workflow CI was added to run the same tests on push and pull_request events.

Codex Task

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

let domain = domain_to_ascii(address).map_err(|cause| {

P1 Badge Enforce URL deny list when normalizing domain hosts

Host::from_str now normalizes non-IP hosts with idna::domain_to_ascii, but that helper uses no ASCII deny list (UseSTD3ASCIIRules=false) and expects the caller to apply additional filtering. Because this parser does not do any post-filtering, inputs with URL-forbidden host code points (or space/control edge cases) can be accepted as Address::Domain, so malformed URLs may parse successfully and later be treated as valid hosts. Use domain_to_ascii_cow(..., AsciiDenyList::URL) (or equivalent URL-host filtering) before constructing Address::Domain.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@code-tc code-tc closed this May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant