Compare commits

...

2 Commits

Author SHA1 Message Date
Tim Donohue
17f5024a97 Merge pull request #4743 from DSpace/backport-4733-to-dspace-8_x
[Port dspace-8_x] SSR: avoid sending new response when headers were already sent
2025-10-01 08:48:27 -05:00
Daniel Coelho
1f8bc7bdd4 SSR: avoid sending new response when headeras were already sent (fixes #2315)
(cherry picked from commit 951c5f69d4)
2025-09-30 21:25:50 +00:00

View File

@@ -269,6 +269,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) {