소스 검색

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() {

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.