mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: enable service worker on assets host
This commit is contained in:
2 files changed
+3
-1
No files matched your search
@@ -158,6 +158,7 @@ export function apply(ctx: Context) {
|
|||||||
`https://${that.request.host}`,
|
`https://${that.request.host}`,
|
||||||
SystemModel.get('server.url'),
|
SystemModel.get('server.url'),
|
||||||
SystemModel.get('server.cdn'),
|
SystemModel.get('server.cdn'),
|
||||||
|
...((SystemModel.get('server.assets') || '').split(',')).filter((i) => i),
|
||||||
],
|
],
|
||||||
domains: SystemModel.get('ui-default.domains') || [],
|
domains: SystemModel.get('ui-default.domains') || [],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -180,7 +180,8 @@ async function get(request: Request) {
|
|||||||
|
|
||||||
function transformUrl(url: string) {
|
function transformUrl(url: string) {
|
||||||
const urlObject = new URL(url);
|
const urlObject = new URL(url);
|
||||||
if (urlObject.pathname.startsWith('/fs/')) urlObject.search = '';
|
const path = urlObject.pathname;
|
||||||
|
if (path.startsWith('/fs/') || path.includes('X-Amz')) urlObject.search = '';
|
||||||
return urlObject.toString();
|
return urlObject.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user