unshiftio / url-parse

Small footprint URL parser that works seamlessly across Node.js and browser environments.
http://unshift.io
MIT License
1.03k stars 104 forks source link

The ability to process unknown protocols is a feature? #232

Closed yhojann-cl closed 2 years ago

yhojann-cl commented 2 years ago

By example: udp://example.com:53 is a valid uri for this component but in the browsers the URL object only parse http|https. Is a feature or a bug according to standar?

lpinca commented 2 years ago

It it a feature.

$ node
Welcome to Node.js v17.9.0.
Type ".help" for more information.
> new URL('udp://example.com:53');
URL {
  href: 'udp://example.com:53',
  origin: 'null',
  protocol: 'udp:',
  username: '',
  password: '',
  host: 'example.com:53',
  hostname: 'example.com',
  port: '53',
  pathname: '',
  search: '',
  searchParams: URLSearchParams {},
  hash: ''
}