Address some static analysis and TODOs (#12)
This commit is contained in:
parent
3de19d38e4
commit
33b9582199
1 changed files with 132 additions and 123 deletions
|
|
@ -1,13 +1,12 @@
|
|||
using ModelContextProtocol.Utils;
|
||||
|
||||
namespace System.Net.Http;
|
||||
|
||||
internal static class HttpClientExtensions
|
||||
{
|
||||
public static async Task<Stream> ReadAsStreamAsync(this HttpContent content, CancellationToken cancellationToken)
|
||||
{
|
||||
if (content is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(content));
|
||||
}
|
||||
Throw.IfNull(content);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return await content.ReadAsStreamAsync();
|
||||
|
|
@ -15,10 +14,7 @@ internal static class HttpClientExtensions
|
|||
|
||||
public static async Task<string> ReadAsStringAsync(this HttpContent content, CancellationToken cancellationToken)
|
||||
{
|
||||
if (content is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(content));
|
||||
}
|
||||
Throw.IfNull(content);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return await content.ReadAsStringAsync();
|
||||
|
|
|
|||
Loading…
Reference in a new issue