We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31c522b commit f958c28Copy full SHA for f958c28
tools/Custom/HttpMessageLogFormatter.cs
@@ -73,7 +73,14 @@ public static async Task<string> GetHttpRequestLogAsync(HttpRequestMessage reque
73
string body = string.Empty;
74
try
75
{
76
- body = (requestClone.Content == null) ? string.Empty : FormatString(await requestClone.Content.ReadAsStringAsync());
+ if (requestClone.Content != null)
77
+ {
78
+ body = FormatString(await requestClone.Content.ReadAsStringAsync());
79
+ }
80
+ else if (requestClone.Content == null && request.Content != null)
81
82
+ body = "Skipped: Content body was disposed before the logger could access it.";
83
84
}
85
catch { }
86
0 commit comments