Skip to content

Commit 1f8bc7b

Browse files
SSR: avoid sending new response when headeras were already sent (fixes #2315)
(cherry picked from commit 951c5f6)
1 parent a9093aa commit 1f8bc7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ function serverSideRender(req, res, next, sendToUser: boolean = true) {
269269
],
270270
})
271271
.then((html) => {
272+
// If headers were already sent, then do nothing else, it is probably a
273+
// redirect response
274+
if (res.headersSent) {
275+
return;
276+
}
277+
272278
if (hasValue(html)) {
273279
// Replace REST URL with UI URL
274280
if (environment.ssr.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {

0 commit comments

Comments
 (0)