fix(chromium): default-deny file:// sub-resources when no prefix is allowed

This commit is contained in:
Julien Neuhart
2026-04-21 20:25:34 +02:00
parent 4b192b1498
commit a2a8c42457
3 changed files with 82 additions and 21 deletions

View File

@@ -189,10 +189,13 @@ type Options struct {
// PDFs with transparency.
OmitBackground bool
// AllowedFilePrefixes restricts file:// sub-resource access to only these
// directory prefixes. Applied in listenForEventRequestPaused in addition
// to the global allow/deny lists. Set internally by route handlers, not
// via form data.
// AllowedFilePrefixes restricts file:// sub-resource access to only
// these directory prefixes. Applied in listenForEventRequestPaused in
// addition to the global allow/deny lists. An empty slice
// default-denies every file:// sub-resource, so routes that legitimately
// render local files (HTML, Markdown) must populate this with the
// request working directory while routes that navigate remote URLs
// leave it empty. Set internally by route handlers, not via form data.
AllowedFilePrefixes []string
}