Skip to content

Commit

Permalink
fix sse
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed May 1, 2023
1 parent e7afac8 commit e967b79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Protocols/Http/ServerSentEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ public function __toString()
if (isset($data['event'])) {
$buffer .= "event: {$data['event']}\n";
}
if (isset($data['data'])) {
$buffer .= 'data: ' . \str_replace("\n", "\ndata: ", $data['data']) . "\n\n";
}
if (isset($data['id'])) {
$buffer .= "id: {$data['id']}\n";
}
if (isset($data['retry'])) {
$buffer .= "retry: {$data['retry']}\n";
}
return $buffer;
if (isset($data['data'])) {
$buffer .= 'data: ' . str_replace("\n", "\ndata: ", $data['data']) . "\n";
}
return $buffer . "\n";
}
}

0 comments on commit e967b79

Please sign in to comment.