From 73ac7cf397513b88c6fb01c882ce7f5c777df703 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Mon, 10 Aug 2026 07:23:21 +0000 Subject: [PATCH] refactor(@angular/ssr): simplify response destroyed/closed check --- packages/angular/ssr/node/src/response.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/angular/ssr/node/src/response.ts b/packages/angular/ssr/node/src/response.ts index 90ed5bb31a67..d3b0cf403090 100644 --- a/packages/angular/ssr/node/src/response.ts +++ b/packages/angular/ssr/node/src/response.ts @@ -17,13 +17,11 @@ import type { Http2ServerResponse } from 'node:http2'; */ function isResponseDestroyedOrClosed(destination: ServerResponse | Http2ServerResponse): boolean { return ( - Boolean(destination.destroyed) || - Boolean(destination.closed) || - Boolean(destination.writableEnded) || + destination.destroyed || + destination.closed || + destination.writableEnded || ('stream' in destination && - (!destination.stream || - Boolean(destination.stream.destroyed) || - Boolean(destination.stream.closed))) + (!destination.stream || destination.stream.destroyed || destination.stream.closed)) ); }