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

Failed to parse absolute url error #173

Closed
henryruhs opened this issue Oct 20, 2015 · 6 comments
Closed

Failed to parse absolute url error #173

henryruhs opened this issue Oct 20, 2015 · 6 comments

Comments

@henryruhs
Copy link

Failed to parse relative url to files data/test.json with version 0.7.3.

Here comes some debug code from the IE9 console:

>>> location.protocol
"https:"

>>> xdomain.parseUrl('data/test.json');
LOG: xdomain (https://this-is-my-slave-url): failed to parse absolute url: data/test.json

>>> xdomain.parseUrl('/data/test.json');
LOG: xdomain (https://this-is-my-slave-url): failed to parse absolute url: /data/test.json

>>> xdomain.parseUrl('//data/test.json');
{
   origin : "https://data",
   path : "test.json"
}
@henryruhs
Copy link
Author

I fixed a couple of certificate errors. This magically fixed my xdomain integration.

Maby parseUrl() fails on invalid certificates? Can you confirm that?

@jpillora
Copy link
Owner

Interesting bug, maybe it failed to convert a protocoless scheme to httpa
and so it just left it as //

Good ol IE :)
On Tue, 20 Oct 2015 at 10:38 PM Henry Ruhs notifications@github.com wrote:

I fixed a couple of certificate errors. This fixed it, is that possible?


Reply to this email directly or view it on GitHub
#173 (comment).

@henryruhs
Copy link
Author

My team needs a fix for that, can we give you a helpful hand? Please suggest where to start?

@jpillora
Copy link
Owner

Still occurring after you've fixed your certificates?
On Sat, 24 Oct 2015 at 2:42 AM Henry Ruhs notifications@github.com wrote:

My team needs a fix for that, can we give you a helpful hand? Please
suggest where to start?


Reply to this email directly or view it on GitHub
#173 (comment).

@henryruhs
Copy link
Author

I fixed the certificates but some AJAX requests to local based services / relative urls cause a crash of the Javascript by xdomain because of the parse error.

@jpillora
Copy link
Owner

it shouldn't be crashing, it should just log a message

https://github.com/jpillora/xdomain/blob/gh-pages/dist/xdomain.js#L1044-L1054

and it shouldn't even appear unless you have debug mode on

https://github.com/jpillora/xdomain/blob/gh-pages/dist/xdomain.js#L1009

parseUrl should fail on relative URLs as relative URLs are same domain and
XDomain can ignore them. aside from the failed to parse error, what's
actually going wrong?

On Sat, Oct 24, 2015 at 10:44 PM Henry Ruhs notifications@github.com
wrote:

I fixed the certificates but some AJAX requests to local based services /
relative urls cause a crash of the Javascript by xdomain because of the
parse error.


Reply to this email directly or view it on GitHub
#173 (comment).

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

No branches or pull requests

2 participants