Author: awiner
Date: Mon Apr 13 23:17:14 2009
New Revision: 764645
URL: http://svn.apache.org/viewvc?rev=764645&view=rev
Log:
Another schemeless URL fix: support schemeless relay URLs across RPC methods.
This was failing for windows.postMessage() (Safari 4 and Firefox 3 at least)
Modified:
incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
Modified:
incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js?rev=764645&r1=764644&r2=764645&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
(original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
Mon Apr 13 23:17:14 2009
@@ -881,7 +881,13 @@
* @member gadgets.rpc
*/
getRelayUrl: function(targetId) {
- return relayUrl[targetId];
+ var url = relayUrl[targetId];
+ // Some RPC methods (wpm, for one) are unhappy with schemeless URLs.
+ if (url.indexOf('//') == 0) {
+ url = document.location.protocol + url;
+ }
+
+ return url;
},
/**