Closed fernandosouza closed 7 years ago
Hey, guys. Could we merge it?
@fernandosouza Will resend with changes.
Hey Eduardo, we are experiencing mixed behaviors from different browsers. And that's due to the fallback for browsers that don't support URL.
The fact the we add http:// when the uri doesn't contain it can lead to the case:
tel:59632145879 - > http://tel:59632145879 - > exception for browsers that support URL and no exception for the others (Safari 5 for example)
We also found that the port number has a maximum value and that's the reason URL throws an exception in this specific example.
On Thu, May 4, 2017, 11:53 Eduardo Lundgren notifications@github.com wrote:
@eduardolundgren commented on this pull request.
In src/parseFromAnchor.js https://github.com/metal/metal-uri/pull/10#discussion_r114794639:
@@ -12,7 +26,7 @@ function parseFromAnchor(opt_uri) { hostname: link.hostname, password: link.password, pathname: link.pathname[0] === '/' ? link.pathname : '/' + link.pathname,
- port: link.port,
- port: extractPortFromURI(opt_uri),
This will be only used for the test. If the user chooses port 0 it will work. This test only detects if the browser natively behaves wrongly.
— You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub https://github.com/metal/metal-uri/pull/10#discussion_r114794639, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJi5I_Z4-q0nLDSiJxluWENo9WUOQttks5r2eZ8gaJpZM4NKyjc .
@brunobasto My comment was related to testing the misleading behavior of Safari and default port 0
. I was proposing a inspection to know if the browser behaves like that instead of always extracting the port from the url string. This would be safer.
Hey, @brunobasto. I've updated the code following your comment. Thx.