Procházet zdrojové kódy

Merged with master

adolfintel před 7 roky
rodič
revize
78f4abd919
2 změnil soubory, kde provedl 12 přidání a 2 odebrání
  1. 12 2
      Frontend/speedtest_worker.js
  2. 0 0
      Frontend/speedtest_worker.min.js

+ 12 - 2
Frontend/speedtest_worker.js

@@ -475,7 +475,12 @@ function ulTest(done) {
 							testStream(i, 0);
 						};
 						xhr[i].open("POST", settings.url_ul + url_sep(settings.url_ul) + "r=" + Math.random(), true); // random string to prevent caching
-						xhr[i].setRequestHeader("Content-Encoding", "identity"); // disable compression (some browsers may refuse it, but data is incompressible anyway)
+						try{
+							xhr[i].setRequestHeader("Content-Encoding", "identity"); // disable compression (some browsers may refuse it, but data is incompressible anyway)
+						}catch(e){}
+						try{
+							xhr[i].setRequestHeader("Content-Type", "application/octet-stream"); //force content-type to application/octet-stream in case the server misinterprets it
+						}catch(e){}
 						xhr[i].send(reqsmall);
 					} else {
 						// REGULAR version, no workaround
@@ -508,7 +513,12 @@ function ulTest(done) {
 						}.bind(this);
 						// send xhr
 						xhr[i].open("POST", settings.url_ul + url_sep(settings.url_ul) + "r=" + Math.random(), true); // random string to prevent caching
-						xhr[i].setRequestHeader("Content-Encoding", "identity"); // disable compression (some browsers may refuse it, but data is incompressible anyway)
+						try{
+							xhr[i].setRequestHeader("Content-Encoding", "identity"); // disable compression (some browsers may refuse it, but data is incompressible anyway)
+						}catch(e){}
+						try{
+							xhr[i].setRequestHeader("Content-Type", "application/octet-stream"); //force content-type to application/octet-stream in case the server misinterprets it
+						}catch(e){}
 						xhr[i].send(req);
 					}
 				}.bind(this),

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
Frontend/speedtest_worker.min.js


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů