Skip to content

Commit 7424dbe

Browse files
committed
Build with 206 fix
1 parent 832fdc6 commit 7424dbe

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

build/jsroot.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const version_id = 'dev',
1111

1212
/** @summary version date
1313
* @desc Release date in format day/month/year like '14/04/2022' */
14-
version_date = '21/05/2024',
14+
version_date = '22/05/2024',
1515

1616
/** @summary version id and date
1717
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -99088,16 +99088,14 @@ class TFile {
9908899088
}
9908999089

9909099090
if (res && first_req) {
99091-
if (file.fAcceptRanges && !first_req.getResponseHeader('Accept-Ranges')) {
99092-
file.fAcceptRanges = false;
99093-
if (res?.byteLength === place[1]) {
99094-
// special case with cernbox, let try to get full size content
99095-
console.warn(`First block is ${place[1]} bytes but browser does not provides access to header - try to read full file`);
99096-
first_block_retry = true;
99097-
return send_new_request();
99098-
}
99091+
// special workaround for servers like cernbox blocking access to some response headers
99092+
// as result, it is not possible to parse multipart responses
99093+
if (file.fAcceptRanges && (first_req.status === 206) && (res?.byteLength === place[1]) && !first_req.getResponseHeader('Content-Range') && (file.fMaxRanges > 1)) {
99094+
console.warn('Server response with 206 code but browser does not provide access to Content-Range header - setting fMaxRanges = 1, consider to load full file with "filename.root+" argument or adjust server configurations');
99095+
file.fMaxRanges = 1;
9909999096
}
9910099097

99098+
// workaround for simpleHTTP
9910199099
const kind = browser.isFirefox ? first_req.getResponseHeader('Server') : '';
9910299100
if (isStr(kind) && kind.indexOf('SimpleHTTP') === 0) {
9910399101
file.fMaxRanges = 1;
@@ -99107,7 +99105,6 @@ class TFile {
9910799105

9910899106
if (res && first_block && !file.fFileContent) {
9910999107
// special case - keep content of first request (could be complete file) in memory
99110-
9911199108
file.fFileContent = new TBuffer(isStr(res) ? res : new DataView(res));
9911299109

9911399110
if (!file.fAcceptRanges)

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
17. Fix - correctly draw only grids with AXIG draw option
2020
18. Fix - log scales on TH3 drawings #306
2121
19. Fix - draw geometry top node volume if all childs not visible #308
22+
20. Fix - properly process 206 server response without Accept-Ranges header https://root-forum.cern.ch/t/59426/
2223

2324

2425
## Changes in 7.6.1

modules/core.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const version_id = 'dev',
44

55
/** @summary version date
66
* @desc Release date in format day/month/year like '14/04/2022' */
7-
version_date = '21/05/2024',
7+
version_date = '22/05/2024',
88

99
/** @summary version id and date
1010
* @desc Produced by concatenation of {@link version_id} and {@link version_date}

0 commit comments

Comments
 (0)