defunctzombie / node-url

node.js core url module as a module
MIT License
375 stars 96 forks source link

cors whitelist checking #49

Closed mahcloud closed 3 years ago

mahcloud commented 4 years ago

I want to use this library for cors whitelist checking. I have a url https://*.netlify.com.

These are the results I get: Url { protocol: 'https:', slashes: true, auth: null, host: '', port: null, hostname: '', hash: null, search: null, query: null, pathname: '/.netlify.com', path: '/.netlify.com', href: 'https:///*.netlify.com' }

I would expect to get: Url { protocol: 'https:', slashes: true, auth: null, host: '.netlify.com', port: null, hostname: '.netlify.com', hash: null, search: null, query: null, pathname: '/', path: '/', href: 'https://*.netlify.com' }

ljharb commented 3 years ago

I don't believe this is a feature node's core url module has - as such, we can't add it. If I'm mistaken, I'm happy to reopen; if not, you're welcome to file a feature request on node itself.