mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Correctly rewrite script/link tags in the proxy (#25204)
Regressed in fe10a3feab
Fixes /theme-qunit
This commit is contained in:
parent
7a8cbf8422
commit
bcb31f79ce
@ -44,10 +44,28 @@ function updateScriptReferences({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const newElements = chunks.map(
|
const newElements = chunks.map((chunk) => {
|
||||||
(chunk) =>
|
let newElement = `<${element.tagName}`;
|
||||||
`<script ${attribute}="${baseURL}${chunk}" data-ember-cli-rewritten="true"></script>`
|
|
||||||
);
|
for (const [attr, value] of element.attributes) {
|
||||||
|
if (attr === attribute) {
|
||||||
|
newElement += ` ${attribute}="${baseURL}${chunk}"`;
|
||||||
|
} else if (value === "") {
|
||||||
|
newElement += ` ${attr}`;
|
||||||
|
} else {
|
||||||
|
newElement += ` ${attr}="${value}"`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newElement += ` data-ember-cli-rewritten="true"`;
|
||||||
|
newElement += `>`;
|
||||||
|
|
||||||
|
if (element.tagName === "script") {
|
||||||
|
newElement += `</script>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return newElement;
|
||||||
|
});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
entrypointName === "discourse" &&
|
entrypointName === "discourse" &&
|
||||||
|
Loading…
Reference in New Issue
Block a user