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

Protocol-relative URL's (i.e. "//mydomain/path") do not work #13

Closed
asilvas opened this issue Aug 30, 2011 · 5 comments
Closed

Protocol-relative URL's (i.e. "//mydomain/path") do not work #13

asilvas opened this issue Aug 30, 2011 · 5 comments
Assignees
Milestone

Comments

@asilvas
Copy link
Contributor

asilvas commented Aug 30, 2011

This is a non-issue for me as I am not using this feature, but wanted to make you aware since I caught it.

<script>
curl = {
   baseUrl: "//cdn1.mydomain.com/root/",  // WONT WORK
   pluginPath: "//cdn2.mydomain.com/root/curl/plugin",  // WONT WORK
   paths: {
      js: "//cdn3.mydomain.com/root/curl/plugin/js" // WONT WORK
   }
}
</script>
<script src="cdn1.mydomain.com/root/curl/curl.js"></script>

The above code will not work. I believe what it is doing is detecting a prefix of a single-forward slash "/" to detect for an absolute path, and ignoring the fact that double-forward means something entirely different.

@asilvas
Copy link
Contributor Author

asilvas commented Aug 30, 2011

This issue is connected with Issue 11

@ghost ghost assigned unscriptable Aug 31, 2011
@unscriptable
Copy link
Member

Thanks! I caught this last night as well. Will add a test case for protocol-relative urls.

@unscriptable
Copy link
Member

I can't seem to repro this anymore. Can you check with the latest in dev branch?

(I did make minor tweaks to the relative url checking regexp just now, but I wasn't able to repro before those changes.)

@asilvas
Copy link
Contributor Author

asilvas commented Aug 31, 2011

Looks like it may have been due to me testing on a local file, versus serving up from a domain. Even still, "//" from a local file will not work -- I believe this to be a browser behavior, as some do not treat local files as "http". Another reason to just re-write http/https instead of protocol relative paths, for use with local tests.

Oddly I was also not able to repro the IE8 double-css issue using the "link!" plugin. You did not make any changes to avoid the double download bug, did you?

@asilvas asilvas closed this as completed Aug 31, 2011
@unscriptable
Copy link
Member

Looks like it may have been due to me testing on a local file, versus serving up from a domain. Even still, "//" from a local file will not work -- I believe this to be a browser behavior, as some do not treat local files as "http". Another reason to just re-write http/https instead of protocol relative paths, for use with local tests.

If you are referring to the "file:" protocol, there are other browser-related problems, too.

Oddly I was also not able to repro the IE8 double-css issue using the "link!" plugin. You did not make any changes to avoid the double download bug, did you?

Yes. I did! :)
See this commit: unscriptable@36ad576

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

2 participants