Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ Let's install the speed test.

Put all files on your web server via FTP or by copying them directly. You can install it in the root, or in a subdirectory.

**Web server upload limit:** The upload test sends POST requests up to 20 MB (configurable with `xhr_ul_blob_megabytes`). Without proper configuration, the server will reject these with HTTP 413, causing wildly inaccurate upload speeds. Configure your web server to accept large request bodies:

Nginx:
```
client_max_body_size 128m;
```

Apache:
```
LimitRequestBody 134217728
```

IIS: Set `maxAllowedContentLength` in `web.config`.

__Important:__ The speed test needs write permissions in the installation folder!

#### ipinfo.io
Expand Down
17 changes: 14 additions & 3 deletions speedtest_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,20 @@ function ulTest(done) {
prevLoaded = event.loaded;
}.bind(this);
xhr[i].upload.onload = function() {
Comment thread
sstidl marked this conversation as resolved.
// this stream sent all the garbage data, start again
tverb("ul stream finished " + i);
testStream(i, 0);
// check HTTP status - non-2xx means server rejected the request (e.g. 413 body too large)
if (xhr[i].status >= 200 && xhr[i].status < 300) {
// this stream sent all the garbage data, start again
tverb("ul stream finished " + i);
testStream(i, 0);
} else {
tverb("ul stream failed with HTTP " + xhr[i].status + " " + i);
if (settings.xhr_ignoreErrors === 0) failed = true; //abort
try {
xhr[i].abort();
} catch (e) {}
delete xhr[i];
if (settings.xhr_ignoreErrors === 1) testStream(i, 0); //restart stream
}
}.bind(this);
xhr[i].upload.onerror = function() {
tverb("ul stream failed " + i);
Expand Down