[Pkg-javascript-commits] [sockjs-client] 209/350: Fix addQuery

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:04:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit 13c3fb04010663323bc6383ac15076f3e59da19b
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Mon Oct 20 19:28:18 2014 -0400

    Fix addQuery
---
 lib/transport/receiver/htmlfile.js | 4 ++--
 lib/transport/sender/xdr.js        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/transport/receiver/htmlfile.js b/lib/transport/receiver/htmlfile.js
index a65d52d..ad7a4cd 100644
--- a/lib/transport/receiver/htmlfile.js
+++ b/lib/transport/receiver/htmlfile.js
@@ -2,6 +2,7 @@
 
 var inherits = require('inherits')
   , iframeUtils = require('../../utils/iframe')
+  , urlUtils = require('../../utils/url')
   , EventEmitter = require('events').EventEmitter
   , random = require('../../utils/random')
   ;
@@ -18,8 +19,7 @@ function HtmlfileReceiver(url) {
   iframeUtils.polluteGlobalNamespace();
 
   this.id = 'a' + random.string(6);
-  url += ((url.indexOf('?') === -1) ? '?' : '&') +
-      'c=' + decodeURIComponent(iframeUtils.WPrefix + '.' + this.id);
+  url = urlUtils.addQuery(url, 'c=' + decodeURIComponent(iframeUtils.WPrefix + '.' + this.id));
 
   debug('using htmlfile', HtmlfileReceiver.htmlfileEnabled);
   var constructor = HtmlfileReceiver.htmlfileEnabled ?
diff --git a/lib/transport/sender/xdr.js b/lib/transport/sender/xdr.js
index 32f4c52..f72a944 100644
--- a/lib/transport/sender/xdr.js
+++ b/lib/transport/sender/xdr.js
@@ -33,7 +33,7 @@ XDRObject.prototype._start = function(method, url, payload) {
   var self = this;
   var xdr = new global.XDomainRequest();
   // IE caches even POSTs
-  url += urlUtils.addQuery('t=' + (+new Date()));
+  url += urlUtils.addQuery(url, 't=' + (+new Date()));
 
   xdr.onerror = function() {
     debug('onerror');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list