From 89ecb59a2a1d29c622bf56da204f90c77b207277 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 24 Nov 2026 16:15:03 +0100 Subject: [PATCH] feat: audit log records the response status at every level (#34663) At the METADATA and REQUEST audit levels the entry for each request had an empty response status, so a denied request looked the same as a successful one. The status code is now recorded at every audit level. It carries no request or response content, so the least detailed level can hold it too. Part of #33249 --- backend/open_webui/utils/audit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/audit.py b/backend/open_webui/utils/audit.py index e2f02dd178..fb4f0d3b09 100644 --- a/backend/open_webui/utils/audit.py +++ b/backend/open_webui/utils/audit.py @@ -230,8 +230,8 @@ class AuditLoggingMiddleware: async with self._audit_context(request) as context: async def send_wrapper(message: ASGISendEvent) -> None: - if self.audit_level == AuditLevel.REQUEST_RESPONSE and ( - capture_body or message['type'] == 'http.response.start' + if message['type'] == 'http.response.start' or ( + self.audit_level == AuditLevel.REQUEST_RESPONSE and capture_body ): await self._capture_response(message, context)