Skip to content

Commit 3603bfb

Browse files
committed
Fix wombatSetup configuration
For some reason, these changes have been made in warc2zim after preparation of the move to python-scraperlib of rewriting logic and we failed to backport them in python-scraperlib in due time
1 parent 1fdc823 commit 3603bfb

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

javascript/src/wombatSetup.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { fuzzyRules } from './fuzzyRules.js';
22
import URI from 'uri-js';
33

4-
// Will be updated by rollup-plugin-version-injector
5-
const VERSION = '[VI]version {version}, built on {date}[/VI]';
6-
console.info(`Running wombat-setup ${VERSION}`);
7-
84
export function applyFuzzyRules(path) {
95
// Apply fuzzy rules to simplify the ZIM path. First matching rule is applied and
106
// result is immediately returned
@@ -292,14 +288,21 @@ export function getWombatInfo(
292288
// The host of the original url
293289
wombat_host: orig_host,
294290

295-
// Extra options ?
296-
wombat_opts: {},
291+
// We are not running inside a service worker, wombat needs to know about it since
292+
// some "magic" URLs like blobs are not available
293+
isSW: false,
297294

298-
// ?
299-
enable_auto_fetch: true,
295+
// Convert all post request to get request
300296
convert_post_to_get: true,
297+
298+
// Not used, we are not replaying in a frame
301299
target_frame: '___wb_replay_top_frame',
302-
isSW: true,
300+
301+
// Not used, we are not running in live mode
302+
enable_auto_fetch: false,
303+
304+
// Extra options, not used
305+
wombat_opts: {},
303306
};
304307
}
305308

javascript/test/wombatSetup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ test('nominalWbInfo', (t) => {
2121
);
2222
t.is(wmInfo.coll, '');
2323
t.is(wmInfo.convert_post_to_get, true);
24-
t.is(wmInfo.enable_auto_fetch, true);
25-
t.is(wmInfo.isSW, true);
24+
t.is(wmInfo.enable_auto_fetch, false);
25+
t.is(wmInfo.isSW, false);
2626
t.is(wmInfo.is_framed, false);
2727
t.is(wmInfo.is_live, false);
2828
t.is(wmInfo.mod, '');

0 commit comments

Comments
 (0)