Skip to content

IPv6 endpoint address not bracketed in URL construction (REC1b2) #2198

@paddybyers

Description

@paddybyers

Spec point

  • REC1b2: When `endpoint` is an IPv6 address (e.g., `::1`), the library should treat it as an explicit hostname and construct valid URLs.

Observed behaviour

`getPrimaryDomainFromEndpoint('::1')` correctly identifies the address as an explicit hostname via `isFqdnIpOrLocalhost`, but URL construction produces `https://::1:443/time` instead of the valid `https://[::1]:443/time`. The missing brackets cause an "Invalid URI" error.

Failing test

Test Expected Actual
`REC1b2 - endpoint as IPv6 address` Valid request to `[::1]` `Invalid URI: https://::1:443/time`

Reproduction

```bash
RUN_DEVIATIONS=1 npx mocha --grep "REC1b2" test/uts/rest/fallback.test.ts
```

From PR #2191, branch `uts-rest`.

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. It's clear that this does need to be fixed.uts-issueIssues raised there there is an apparent discrepancy between this library and the UTS tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions