SSR: avoid sending new response when headeras were already sent (fixes #2315)

(cherry picked from commit 951c5f69d4)
This commit is contained in:
Daniel Coelho
2025-09-22 08:25:06 -03:00
committed by github-actions[bot]
parent 177d57b65f
commit 99244c4e93

View File

@@ -268,6 +268,12 @@ function serverSideRender(req, res, next, sendToUser: boolean = true) {
],
})
.then((html) => {
// If headers were already sent, then do nothing else, it is probably a
// redirect response
if (res.headersSent) {
return;
}
if (hasValue(html)) {
// Replace REST URL with UI URL
if (environment.ssr.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {