mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17: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}`,
|
||||
SystemModel.get('server.url'),
|
||||
SystemModel.get('server.cdn'),
|
||||
...((SystemModel.get('server.assets') || '').split(',')).filter((i) => i),
|
||||
],
|
||||
domains: SystemModel.get('ui-default.domains') || [],
|
||||
};
|
||||
|
||||
@@ -180,7 +180,8 @@ async function get(request: Request) {
|
||||
|
||||
function transformUrl(url: string) {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user