From 8cac77ed31da6bae22f6d9a856c0522da0a76d12 Mon Sep 17 00:00:00 2001 From: team 1 Date: Tue, 14 Apr 2026 20:23:05 +0200 Subject: [PATCH] optimize intention --- src/Controller/AskSseController.php | 10 ++++++---- src/Http/ClientIdResolver.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Controller/AskSseController.php b/src/Controller/AskSseController.php index 245079b..866f799 100644 --- a/src/Controller/AskSseController.php +++ b/src/Controller/AskSseController.php @@ -52,6 +52,7 @@ final readonly class AskSseController if ($prompt === '') { $this->sendEvent('error', 'Empty prompt'); + $this->sendEvent('done', '[DONE]'); return; } @@ -63,11 +64,12 @@ final readonly class AskSseController $chunk = str_replace(["\r\n", "\r"], "\n", $chunk); $this->sendData($chunk); } - - $this->sendEvent('done', '[DONE]'); } catch (\Throwable $e) { - $this->sendData('❌ Stream abgebrochen: ' . $e->getMessage() . ''); - $this->sendEvent('done', '[DONE]'); + $this->sendData( + '❌ Stream abgebrochen: ' + . htmlspecialchars($e->getMessage(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') + . '' + ); } // --------------------------------------------------------- diff --git a/src/Http/ClientIdResolver.php b/src/Http/ClientIdResolver.php index 8558354..9f167d9 100644 --- a/src/Http/ClientIdResolver.php +++ b/src/Http/ClientIdResolver.php @@ -35,7 +35,7 @@ final class ClientIdResolver value: $clientId, expire: strtotime('+1 year'), path: '/', - secure: false, // set true in production with HTTPS + secure: true, // set true in production with HTTPS httpOnly: true, sameSite: Cookie::SAMESITE_LAX )