-
Notifications
You must be signed in to change notification settings - Fork 221
Open
Description
Hi,
First of all let me thank you for a fantastic library.
I recently was using the beta version of the library for a project and got stuck with the following issue.
I have noticed a small issue in ODataResponseMessage GetStreamAsync Method.
dotnetstandard 2 onwards HttpResponseMessage.Content directly supports the ReadAsStreamAsync method. Hence the typecast to StreamContent. The above typecase fails as the response.Content is of type NoWriteNoSeekStreamContent. So propose the following change
As is:
public Task GetStreamAsync()
{
var responseContent = _response.Content as StreamContent;
if (responseContent != null)
{
return responseContent.ReadAsStreamAsync();
}
else
{
var completionSource = new TaskCompletionSource();
completionSource.SetResult(Stream.Null);
return completionSource.Task;
}
}
To be:
public Task GetStreamAsync()
{
var responseContent = _response.Content;
if (responseContent != null)
{
return responseContent.ReadAsStreamAsync();
}
else
{
var completionSource = new TaskCompletionSource();
completionSource.SetResult(Stream.Null);
return completionSource.Task;
}
}
Do let me know your thoughts.
Thanks,
Neeraj
Metadata
Metadata
Assignees
Labels
No labels