mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
SSR: avoid sending new response when headeras were already sent (fixes #2315)
(cherry picked from commit 951c5f69d4
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
177d57b65f
commit
99244c4e93
@@ -268,6 +268,12 @@ function serverSideRender(req, res, next, sendToUser: boolean = true) {
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
.then((html) => {
|
.then((html) => {
|
||||||
|
// If headers were already sent, then do nothing else, it is probably a
|
||||||
|
// redirect response
|
||||||
|
if (res.headersSent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (hasValue(html)) {
|
if (hasValue(html)) {
|
||||||
// Replace REST URL with UI URL
|
// Replace REST URL with UI URL
|
||||||
if (environment.ssr.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {
|
if (environment.ssr.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {
|
||||||
|
Reference in New Issue
Block a user