This commit is contained in:
2023-11-02 14:41:32 -07:00
parent 3dd4034a84
commit 03bd20fc8c
16 changed files with 142 additions and 143 deletions

View File

@ -43,7 +43,8 @@ public class ApiLoggingMiddleware
else
{
// if there are content type filters configured, only log is the request begins with one of them
doLogging = _AppSettings.ApiLoggingContentTypes.Split(';').Any(ct => httpContext.Request.ContentType.StartsWith(ct));
string? contentType = httpContext.Request.ContentType;
doLogging = contentType is not null && _AppSettings.ApiLoggingContentTypes.Split(';').Any(ct => contentType.StartsWith(ct));
}
}
}