Author: lindner
Date: Wed Nov 12 15:25:53 2008
New Revision: 713559
URL: http://svn.apache.org/viewvc?rev=713559&view=rev
Log:
SHINDIG-676 | avoid st=null URLs, Patch from Adam Winer
Modified:
incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js
Modified:
incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js?rev=713559&r1=713558&r2=713559&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js
(original)
+++ incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js Wed
Nov 12 15:25:53 2008
@@ -134,9 +134,14 @@
"POST_DATA" : gadgets.json.stringify(jsonBatchData)
};
- this.sendRequest(this.baseUrl_ + "/rpc?st=" +
- encodeURIComponent(shindig.auth.getSecurityToken()),
- sendResponse, makeRequestParams, "application/json");
+ var url = [this.baseUrl_, "/rpc"];
+ var token = shindig.auth.getSecurityToken();
+ if (token) {
+ url.push("?st=", encodeURIComponent(token));
+ }
+
+ this.sendRequest(url.join(''), sendResponse, makeRequestParams,
+ "application/json");
};
JsonRpcContainer.prototype.sendRequest = function(relativeUrl, callback,
params, contentType) {