Skip to content

Commit

Permalink
dont log Ignoring request with Size null (#1348)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Nov 25, 2021
1 parent 3d186db commit c0c7e39
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Features

- Dont log "Ignoring request with Size" when null ([#1348](https://github.com/getsentry/sentry-dotnet/pull/1348))
- Move to stable v6 for `Microsoft.Extensions.*` packages ([#1347](https://github.com/getsentry/sentry-dotnet/pull/1347))

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ public ProtobufRequestExtractionDispatcher(IEnumerable<IProtobufRequestPayloadEx
return null;
}

_options.Log(SentryLevel.Warning,
"Ignoring request with Size {0} and configuration RequestSize {1}", null, request.ContentLength, size);

return null;
}
}
7 changes: 5 additions & 2 deletions src/Sentry/Extensibility/RequestBodyExtractionDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ public RequestBodyExtractionDispatcher(IEnumerable<IRequestPayloadExtractor> ext
return null;
}

_options.LogWarning("Ignoring request with Size {0} and configuration RequestSize {1}",
request.ContentLength, size);
if (request.ContentLength is not null)
{
_options.LogWarning("Ignoring request with Size {0} and configuration RequestSize {1}",
request.ContentLength, size);
}

return null;
}
Expand Down

0 comments on commit c0c7e39

Please sign in to comment.