瀏覽代碼

fix id GET request caching bug

Michelle Bu 12 年之前
父節點
當前提交
be2875d2c7
共有 3 個文件被更改,包括 4 次插入0 次删除
  1. 2 0
      dist/peer.js
  2. 0 0
      dist/peer.min.js
  3. 2 0
      lib/peer.js

+ 2 - 0
dist/peer.js

@@ -1196,6 +1196,8 @@ Peer.prototype._getId = function(cb) {
   try {
     var http = new XMLHttpRequest();
     var url = 'http://' + this._options.host + ':' + this._options.port + '/' + this._options.key + '/id';
+    var queryString = '?ts=' + new Date().getTime() + '' + Math.random();
+    url += queryString;
     // If there's no ID we need to wait for one before trying to init socket.
     http.open('get', url, true);
     http.onreadystatechange = function() {

文件差異過大導致無法顯示
+ 0 - 0
dist/peer.min.js


+ 2 - 0
lib/peer.js

@@ -61,6 +61,8 @@ Peer.prototype._getId = function(cb) {
   try {
     var http = new XMLHttpRequest();
     var url = 'http://' + this._options.host + ':' + this._options.port + '/' + this._options.key + '/id';
+    var queryString = '?ts=' + new Date().getTime() + '' + Math.random();
+    url += queryString;
     // If there's no ID we need to wait for one before trying to init socket.
     http.open('get', url, true);
     http.onreadystatechange = function() {

部分文件因文件數量過多而無法顯示