Skip to content

Commit c342dd0

Browse files
committed
Skip write audit logs if auditLogInfo.HttpMethod is GET/Head.
While `IsEnabledForGetRequests` is `false`.
1 parent 6385219 commit c342dd0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ private async Task<bool> ShouldWriteAuditLogAsync(
191191
}
192192

193193
if (!options.IsEnabledForGetRequests &&
194-
invocation.Method.Name.StartsWith("Get", StringComparison.OrdinalIgnoreCase))
194+
(string.Equals(auditLogInfo.HttpMethod, "Get", StringComparison.OrdinalIgnoreCase) ||
195+
string.Equals(auditLogInfo.HttpMethod, "Head", StringComparison.OrdinalIgnoreCase) ||
196+
invocation.Method.Name.StartsWith("Get", StringComparison.OrdinalIgnoreCase)))
195197
{
196198
return false;
197199
}

0 commit comments

Comments
 (0)