When using Audit.Net I'm including entire response to be audited such as response content, headers and IncludeHeaders too, below is my configuration:
mvcOptions.AddAuditFilter(a => a
.LogRequestIf(d => d.HttpContext.Request.Method != HttpMethods.Get)
.WithEventType("{verb}.{controller}.{action}")
.IncludeHeaders()
.IncludeResponseBody()
.IncludeResponseHeaders());
But I'm able to see only below response headers.
"Headers": {
"Connection": "keep-alive",
"Content-Type": "application/json",
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Host": "localhost:50266",
"User-Agent": "PostmanRuntime/7.26.10",
"Content-Length": "3503",
"Postman-Token": "645b83e3-d1b6-40f8-b615-85052b614b37"
},
"ResponseHeaders": {
"Request-Context": "appId=xxxxxxx",
"Referrer-Policy": "no-referrer",
"X-Content-Type-Options": "nosniff",
"Content-Security-Policy": "default-src 'self';"
}
My response also contains Location header but the same is not visible in the audit log. This request was raised through Postman and the response headers in postman can be seen below:
Location header is clearly visible in postman, but the same is missing in audit log, what did I miss here? Any pointers please?