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

This commit is contained in:
Daniel Coelho
2025-09-22 08:25:06 -03:00
parent dba2d7a1e2
commit 951c5f69d4

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) {