Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for engine_files lastmod metadata #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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},
}
Loading