Skip to content

Commit 1ee8441

Browse files
committed
add exception for redirect in audit log
1 parent c1ae295 commit 1ee8441

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

coderd/audit.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,14 @@ func auditLogDescription(alog database.GetAuditLogsOffsetRow) string {
282282
_, _ = b.WriteString("{user} ")
283283
}
284284

285-
if alog.AuditLog.StatusCode >= 400 {
285+
switch {
286+
case alog.AuditLog.StatusCode == int32(http.StatusSeeOther):
287+
_, _ = b.WriteString("was redirected attempting to ")
288+
_, _ = b.WriteString(string(alog.AuditLog.Action))
289+
case alog.AuditLog.StatusCode >= 400:
286290
_, _ = b.WriteString("unsuccessfully attempted to ")
287291
_, _ = b.WriteString(string(alog.AuditLog.Action))
288-
} else {
292+
default:
289293
_, _ = b.WriteString(codersdk.AuditAction(alog.AuditLog.Action).Friendly())
290294
}
291295

0 commit comments

Comments
 (0)