optimize intention
This commit is contained in:
@@ -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>'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
|
|||||||
@@ -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
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user