Skip to content

Commit

Permalink
fix(sandbox): An absolute path does not need to be transformed again (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoushaw authored Mar 18, 2024
1 parent 20a9051 commit 3381742
Show file tree
Hide file tree
Showing 2 changed files with 5,303 additions and 5,941 deletions.
3 changes: 3 additions & 0 deletions packages/utils/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ export function isAbsolute(url: string) {
}

export function transformUrl(resolvePath: string, curPath: string) {
if (curPath.startsWith('http') || curPath.startsWith('//')) {
return curPath;
}
const baseUrl = new URL(resolvePath, location.href);
const realPath = new URL(curPath, baseUrl.href);
return realPath.href;
Expand Down
Loading

0 comments on commit 3381742

Please sign in to comment.