Skip to content

Commit

Permalink
Update: As per #2006 Empty body being redacted is confusing
Browse files Browse the repository at this point in the history
When the body is empty, I set it to an empty string
  • Loading branch information
redcinelli committed Nov 21, 2023
1 parent c3525df commit 959453b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Elastic.Apm/Extensions/TransactionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ internal static void CollectRequestBody(this ITransaction transaction, bool isFo
if (transaction.IsCaptureRequestBodyEnabled(isForError) && IsCaptureRequestBodyEnabledForContentType(transaction, httpRequest?.ContentType, logger))
body = httpRequest.ExtractBody(logger, transaction.Configuration);

// According to the documentation - the default value of 'body' is '[Redacted]'
transaction.Context.Request.Body = body ?? Consts.Redacted;
transaction.Context.Request.Body = body ?? string.Empty;
}

internal static bool IsCaptureRequestBodyEnabled(this ITransaction transaction, bool isForError) =>
Expand Down

0 comments on commit 959453b

Please sign in to comment.