Skip to content

Commit

Permalink
fix: only append base to internal non-relative urls (#1195)
Browse files Browse the repository at this point in the history
Co-authored-by: Soon <sooniter@gmail.com>
  • Loading branch information
Timeless0911 and SoonIter authored Jun 20, 2024
1 parent c91f6d3 commit 040dcb3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/runtime/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export function normalizeImagePath(imagePath: string) {
if (!isProd) {
return imagePath;
}
if (isExternalUrl(imagePath) || isDataUrl(imagePath)) {
if (isExternalUrl(imagePath) || isDataUrl(imagePath) || imagePath.startsWith('//')) {
return imagePath;
}
// only append base to internal non-relative urls
if (!imagePath.startsWith('/')) {
return imagePath;
}

Expand Down

0 comments on commit 040dcb3

Please sign in to comment.