Skip to content
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

Should host and port get parsed for strange URL schemes? #20733

Closed
rotu opened this issue Sep 28, 2023 · 2 comments
Closed

Should host and port get parsed for strange URL schemes? #20733

rotu opened this issue Sep 28, 2023 · 2 comments
Labels
invalid what appeared to be an issue with Deno wasn't

Comments

@rotu
Copy link
Contributor

rotu commented Sep 28, 2023

Trying to parse a nonstandard URL protocol is very different between Deno and browsers. In particular whether the host and port get parsed out or whether everything is treated as part of the pathname.

console.log(new URL("wtf://127.0.0.1:8000/baz"))

Deno, Node, Safari, Bun give something like:

URL {
  href: "wtf://127.0.0.1:8000/baz",
  protocol: "wtf:",
  host: "127.0.0.1:8000",
  hostname: "127.0.0.1",
  port: "8000",
  pathname: "/baz"
}

Chrome, Firefox give something like:

URL {
  href: "wtf://127.0.0.1:8000/baz",
  protocol: "wtf:",
  hostname: "",
  port: "",
  pathname: "//127.0.0.1:8000/baz"
}
@rotu
Copy link
Contributor Author

rotu commented Sep 29, 2023

Hmm... I think Deno implements the standard correctly here and that both Chrome and Firefox are in error. see e.g. the "Parsing: gopher://foo:443/ without base" case in web platform tests

@lucacasonato
Copy link
Member

Chrome and Firefox are wrong.

@lucacasonato lucacasonato closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2023
@lucacasonato lucacasonato added the invalid what appeared to be an issue with Deno wasn't label Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid what appeared to be an issue with Deno wasn't
Projects
None yet
Development

No branches or pull requests

2 participants