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

parseURL can't handle IPv6 addresses #23

Open
georgehrke opened this issue Sep 6, 2016 · 9 comments
Open

parseURL can't handle IPv6 addresses #23

georgehrke opened this issue Sep 6, 2016 · 9 comments

Comments

@georgehrke
Copy link
Contributor

The regex in the parseURL function can't parse IPv6 addresses.

corresponding line: https://github.com/evert/davclient.js/blob/fc7519d2c81f689dba55d0a4504803c5774741ff/lib/client.js#L364

not compatible ipv6 issue 718 owncloud-calendar safari technology preview today at 9 32 35 pm

@georgehrke
Copy link
Contributor Author

This might be a solution: https://gist.github.com/jlong/2428561

@georgehrke
Copy link
Contributor Author

This would introduce a dependency on the document object though :/

@evert
Copy link
Collaborator

evert commented Sep 6, 2016

Would be good to ditch the ugly regex though! One option to support both server-side and client-side scenarios is to use document if it's available, and nodejs's url object otherwise...

The only reason we need to parse the url there is for the resolve method. So maybe there's an alternative to resolve relative urls as well?

@tcitworld
Copy link
Member

Otherwise, there's the URL interface : https://developer.mozilla.org/en/docs/Web/API/URL

new URL('https://github.com/evert/davclient.js/issues/');
URL { href: "https://github.com/evert/davclient.…", origin: "https://github.com", protocol: "https:", username: "", password: "", host: "github.com", hostname: "github.com", port: "", pathname: "//issues/23", search: "" }

@staabm
Copy link

staabm commented Sep 7, 2016

the URL Interface seems no to be Edge compatible

@tcitworld
Copy link
Member

From what I see here, most of it works.

@staabm
Copy link

staabm commented Sep 7, 2016

ohh, I guess you are right. I tested it in the console without being on the same domain. so I got errors in the dev console because x-domain.. when doing it in the same domain, things look better on IE11.

@PVince81
Copy link
Contributor

PVince81 commented Sep 7, 2016

@evert I never understood why there was this regexp in the first place. Is it for server-side davclient support ?

@evert
Copy link
Collaborator

evert commented Sep 8, 2016

I think I just kept the php approach, so I needed a simple replacement for parse_url. But yea, I think we only use it for resolve, so as long as resolve works correctly, I don't really care.

The current resolve is imho also flawed at the moment. Based on earlier Sabre\DAV\Client which has since then been fixed to follow the standard better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants