mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: update polyfill
This commit is contained in:
7 files changed
+44
-13
No files matched your search
@@ -144,8 +144,18 @@ export async function apply(ctx: Context) {
|
||||
});
|
||||
if (process.env.HYDRO_CLI) return;
|
||||
ctx.inject(['server'], ({ server, on }) => {
|
||||
let endpoint = builtinConfig.file.endPoint;
|
||||
if (builtinConfig.file.type === 's3' && !builtinConfig.file.pathStyle) {
|
||||
try {
|
||||
const parsed = new URL(builtinConfig.file.endPoint);
|
||||
parsed.hostname = `${builtinConfig.file.bucket}.${parsed.hostname}`;
|
||||
endpoint = parsed.toString();
|
||||
} catch (e) {
|
||||
logger.warn('Failed to parse file endpoint');
|
||||
}
|
||||
}
|
||||
const proxyMiddleware = proxy('/fs', {
|
||||
target: builtinConfig.file.endPoint,
|
||||
target: endpoint,
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace('/fs', ''),
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user