Skip to content

Commit 91c89e5

Browse files
committed
Optimized code
1 parent 50a57c9 commit 91c89e5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Server.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,9 @@ public function onHandShake($request, $response): void
216216
} finally {
217217
isset($fd) && $this->getSender()->setResponse($fd, null);
218218
// Send the Response to client.
219-
if (! isset($psr7Response) || ! $psr7Response instanceof Psr7Response) {
220-
return;
219+
if (isset($psr7Response) && $psr7Response instanceof ResponseInterface) {
220+
$this->responseEmitter->emit($psr7Response, $response, true);
221221
}
222-
$this->responseEmitter->emit($psr7Response, $response, true);
223222
}
224223
}
225224

0 commit comments

Comments
 (0)