Explorar o código

fix id GET request caching bug

Michelle Bu %!s(int64=12) %!d(string=hai) anos
pai
achega
be2875d2c7
Modificáronse 3 ficheiros con 4 adicións e 0 borrados
  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() {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 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() {

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio