Parcourir la source

fix id GET request caching bug

Michelle Bu il y a 12 ans
Parent
commit
be2875d2c7
3 fichiers modifiés avec 4 ajouts et 0 suppressions
  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() {

Fichier diff supprimé car celui-ci est trop grand
+ 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() {

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff