Skip to content

Commit cf41368

Browse files
authored
Merge pull request #21463 from abpframework/AuditingInterceptor
Skip to write audit logs if `auditLogInfo.HttpMethod` is `GET/Head`.
2 parents 6385219 + c342dd0 commit cf41368

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)