Skip to content

Commit

Permalink
Add support for engine_files lastmod metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
dfabulich committed Jan 23, 2025
1 parent 655b092 commit d078e43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/common/file/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ async function fetch_resource_inner(options: DownloadOptions, path: string, prog
let url: URL | string
try {
url = new URL(path, lib_path)
const lastmod = options.engine_files?.[path]
if (lastmod) {
url.searchParams.set('lastmod', lastmod)
}
}
catch {
url = lib_path + path
Expand Down
3 changes: 2 additions & 1 deletion src/common/file/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export interface DownloadOptions {
/** Use the file proxy; if disabled may mean that some files can't be loaded */
// We could just say to exclude proxy_url instead?
use_proxy?: boolean | number,
}
engine_files?: {[key: string]: string},
}

0 comments on commit d078e43

Please sign in to comment.