Skip to content

Commit caf8458

Browse files
[IIIF-188] fix SSR callback
1 parent e261d36 commit caf8458

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ function serverSideRender(req, res, next, sendToUser: boolean = true) {
316316
],
317317
})
318318
.then((html) => {
319+
if (res.writableEnded || res.headersSent || res.finished) {
320+
return;
321+
}
322+
319323
if (hasValue(html)) {
320324
// Replace REST URL with UI URL
321325
if (environment.ssr.replaceRestUrl && REST_BASE_URL !== environment.rest.baseUrl) {

0 commit comments

Comments
 (0)