bluesky-social / atproto

Social networking technology created by Bluesky
Other
6.89k stars 486 forks source link

`AtUri` parses unicode domains incorrectly #2966

Open tom-sherman opened 2 weeks ago

tom-sherman commented 2 weeks ago

Describe the bug

To Reproduce

Steps to reproduce the behavior:

> deno repl
Deno 2.0.5
exit using ctrl+d, ctrl+c, or close()
> import { AtUri } from "npm:@atproto/syntax"
undefined
> new AtUri("at://mañana.com")
AtUri {
  hash: "",
  host: "at:",
  pathname: "//mañana.com",
}

Expected behavior

I'd like for this to be punycode encoded to match the behaviour of the whatwg URL API ie.

AtUri {
  hash: "",
  host: "xn--maana-pta.com",
  pathname: "",
}

Details

Additional context