optimize intention

This commit is contained in:
team 1
2026-04-14 20:23:05 +02:00
parent c8d7ecf1f5
commit 8cac77ed31
2 changed files with 7 additions and 5 deletions

View File

@@ -52,6 +52,7 @@ final readonly class AskSseController
if ($prompt === '') { if ($prompt === '') {
$this->sendEvent('error', 'Empty prompt'); $this->sendEvent('error', 'Empty prompt');
$this->sendEvent('done', '[DONE]');
return; return;
} }
@@ -63,11 +64,12 @@ final readonly class AskSseController
$chunk = str_replace(["\r\n", "\r"], "\n", $chunk); $chunk = str_replace(["\r\n", "\r"], "\n", $chunk);
$this->sendData($chunk); $this->sendData($chunk);
} }
$this->sendEvent('done', '[DONE]');
} catch (\Throwable $e) { } catch (\Throwable $e) {
$this->sendData('<span class="text-danger">❌ Stream abgebrochen: ' . $e->getMessage() . '</span>'); $this->sendData(
$this->sendEvent('done', '[DONE]'); '<span class="text-danger">❌ Stream abgebrochen: '
. htmlspecialchars($e->getMessage(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8')
. '</span>'
);
} }
// --------------------------------------------------------- // ---------------------------------------------------------

View File

@@ -35,7 +35,7 @@ final class ClientIdResolver
value: $clientId, value: $clientId,
expire: strtotime('+1 year'), expire: strtotime('+1 year'),
path: '/', path: '/',
secure: false, // set true in production with HTTPS secure: true, // set true in production with HTTPS
httpOnly: true, httpOnly: true,
sameSite: Cookie::SAMESITE_LAX sameSite: Cookie::SAMESITE_LAX
) )