From f7733a74ab8f1c7ecfaa302fd9c13b4c3d395f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Luiz=20dos=20Santos?= Date: Tue, 12 Feb 2019 15:43:18 -0200 Subject: [PATCH] Compatibility fix for Caddy web server Add Content-Type: application/octet-stream for upload test. This fixes a compatibility issue with Caddy web server --- speedtest_worker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/speedtest_worker.js b/speedtest_worker.js index de8969d..9fcfaf5 100644 --- a/speedtest_worker.js +++ b/speedtest_worker.js @@ -471,6 +471,7 @@ function ulTest(done) { }; 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) + xhr[i].setRequestHeader("Content-Type", "application/octet-stream"); xhr[i].send(reqsmall); } else { // REGULAR version, no workaround @@ -504,6 +505,7 @@ function ulTest(done) { // 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) + xhr[i].setRequestHeader("Content-Type", "application/octet-stream"); xhr[i].send(req); } }.bind(this),