mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-02 01:42:53 -05:00
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
This commit is contained in:
1 parent
af44e5f92c
commit
89ecb59a2a
1 file changed
+2
-2
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user