-
Notifications
You must be signed in to change notification settings - Fork 55
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
[IE] Port is resolved to 80 when unspecified #5
Comments
+1 This library adds default values for things that are not given so validation based on this library will be troublesome. Instead of creating a new issue I will just add one here. When I do Is this something that we can have a fix for or is there another library we can use as a polyfill? whatwg-url, universal-url etc. all seems to not provide polyfills. |
This lib is a trade-off between size, speed and compliance. I wrote here the full polyfill for nodejs: https://github.com/lifaon74/whatwg-url. The final size is 272Ko which is too much for a polyfill, but not for a server. You can use this library (url-polyfill) safely in 99% of the cases (but for example doesn't include puny codes, some unicode chars, etc...). For specific usage you could probably use this lib with the conjunction of regexp |
I understand. But adding this RegExp in the constructor of this lib, just throwing an exception if the input is wrong would make it so much cleaner. If I have to add this code in every project I have with this polyfill it will create a river of mess where I sometimes use Just validating the constructor if it is IE and throwing an exception would really not add much to the size either. And then it would be close to perfect in terms of compliance too. |
Input:
Output:
Expected (as is in Chrome):
Edit: this consequence seems to occur in IE only :/
The text was updated successfully, but these errors were encountered: