aboutsummaryrefslogtreecommitdiff
path: root/sokol_fetch.h
diff options
context:
space:
mode:
authorJosh Faust <jfaust@fyusion.com>2021-01-20 16:32:21 -0800
committerJosh Faust <jfaust@fyusion.com>2021-01-20 16:32:21 -0800
commit5bc1b13a7d0082d64e168f933aa645ccd119553a (patch)
tree47efddb231fa695b413ba5bd69a5baed5115755d /sokol_fetch.h
parent5fbb6a25501e5478674ca0600a7539033592d749 (diff)
Fix range request to not overlap reads
Diffstat (limited to 'sokol_fetch.h')
-rw-r--r--sokol_fetch.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sokol_fetch.h b/sokol_fetch.h
index c40da9c4..1a8ac54b 100644
--- a/sokol_fetch.h
+++ b/sokol_fetch.h
@@ -1942,7 +1942,7 @@ EM_JS(void, sfetch_js_send_get_request, (uint32_t slot_id, const char* path_cstr
req.responseType = 'arraybuffer';
var need_range_request = (bytes_to_read > 0);
if (need_range_request) {
- req.setRequestHeader('Range', 'bytes='+offset+'-'+(offset+bytes_to_read));
+ req.setRequestHeader('Range', 'bytes='+offset+'-'+(offset+bytes_to_read-1));
}
req.onreadystatechange = function() {
if (this.readyState == this.DONE) {