Skip to content

Commit 3381742

Browse files
authored
fix(sandbox): An absolute path does not need to be transformed again (#662)
1 parent 20a9051 commit 3381742

File tree

2 files changed

+5303
-5941
lines changed

2 files changed

+5303
-5941
lines changed

packages/utils/src/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ export function isAbsolute(url: string) {
371371
}
372372

373373
export function transformUrl(resolvePath: string, curPath: string) {
374+
if (curPath.startsWith('http') || curPath.startsWith('//')) {
375+
return curPath;
376+
}
374377
const baseUrl = new URL(resolvePath, location.href);
375378
const realPath = new URL(curPath, baseUrl.href);
376379
return realPath.href;

0 commit comments

Comments
 (0)