mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
In block mode the messagePiiFilter middleware called denyRequest before mutating req.body.text, so the original credential still reached denyRequest. That helper builds a user message from req.body.text and emits a `created` SSE event for it; for an existing conversation with a parent message id it also persists the user message to MongoDB. The assistant turn was refused but the credential itself surfaced in the chat-history bubble and the database row. Moved the req.body.text mutation ahead of the block branch so every downstream code path sees the redacted text. denyRequest now builds its user message and any persisted row from the scrubbed string, the warn and silent paths are unchanged, and the post-handlers (moderateText, the agent run) continue to receive redacted input. |
||
|---|---|---|
| .. | ||
| controllers | ||
| middleware | ||
| routes | ||
| services | ||
| utils | ||
| cleanup.js | ||
| experimental.js | ||
| index.js | ||
| index.metrics.spec.js | ||
| index.spec.js | ||
| socialLogins.js | ||
| socialLogins.spec.js | ||
| telemetry.js | ||
| telemetry.spec.js | ||