Skip to content

Commit 58b0f85

Browse files
authored
[5.2] Web Asset Manager incorect loading of external resource with / at the end (#44774)
1 parent 2f68102 commit 58b0f85

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libraries/src/WebAsset/WebAssetItem.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ public function getUri($resolvePath = true): string
177177
break;
178178
default:
179179
// Asset for the ES modules may give us a folder for ESM import map
180-
if (str_ends_with($path, '/') && !str_starts_with($path, '.')) {
180+
if (
181+
$this->getOption('importmap') && !$this->isPathExternal($path) &&
182+
str_ends_with($path, '/') && !str_starts_with($path, '.')
183+
) {
181184
$path = Uri::root(true) . '/' . $path;
182185
}
183186
break;

0 commit comments

Comments
 (0)