Skip to content

Commit d078e43

Browse files
committed
Add support for engine_files lastmod metadata
Apropos curiousdannii/parchment#177
1 parent 655b092 commit d078e43

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/common/file/browser.ts

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ async function fetch_resource_inner(options: DownloadOptions, path: string, prog
5555
let url: URL | string
5656
try {
5757
url = new URL(path, lib_path)
58+
const lastmod = options.engine_files?.[path]
59+
if (lastmod) {
60+
url.searchParams.set('lastmod', lastmod)
61+
}
5862
}
5963
catch {
6064
url = lib_path + path

src/common/file/interface.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ export interface DownloadOptions {
2525
/** Use the file proxy; if disabled may mean that some files can't be loaded */
2626
// We could just say to exclude proxy_url instead?
2727
use_proxy?: boolean | number,
28-
}
28+
engine_files?: {[key: string]: string},
29+
}

0 commit comments

Comments
 (0)