Skip to content

Commit

Permalink
Fixed an error when output buffering disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
slavarazum committed Dec 14, 2023
1 parent f61d8c2 commit 201b005
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Sse/ServerSentEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ public function __toString(): string
public function __invoke()
{
echo $this;
ob_flush();

if (ob_get_level()) {
ob_flush();
}

flush();
}

Expand Down

0 comments on commit 201b005

Please sign in to comment.