-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementations of new HttpContent sync methods. #38635
Implementations of new HttpContent sync methods. #38635
Conversation
Cleanup after move to WinHttpHandler, removed unused compiler constant.
Tagging subscribers to this area: @dotnet/ncl |
4b27d68
to
8a68107
Compare
src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/NoWriteNoSeekStreamContent.cs
Outdated
Show resolved
Hide resolved
8a68107
to
7ff4989
Compare
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/DecompressionHandler.cs
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs
Show resolved
Hide resolved
98a46f2
to
14eae27
Compare
ce19b45
to
6e90249
Compare
7de7713
to
5c20f40
Compare
5c20f40
to
4505b53
Compare
a52ca4a
to
bc77fbb
Compare
/azp run runtime-libraries outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to JsonContent LGTM.
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
ad11c9a
to
6d34cfc
Compare
@@ -11,6 +11,7 @@ public partial class ByteArrayContent : System.Net.Http.HttpContent | |||
{ | |||
public ByteArrayContent(byte[] content) { } | |||
public ByteArrayContent(byte[] content, int offset, int count) { } | |||
protected override System.IO.Stream CreateContentReadStream(System.Threading.CancellationToken cancellationToken) { throw null; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this was not regenerated in #37494
WinHttpHandler changes reverted, regenerated ref sources, added/enables more tests. @stephentoub It's ready for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm after question re: CreateRequest
is addressed.
using (HttpResponseMessage response = await client.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead)) | ||
using (HttpResponseMessage response = await client.SendAsync(TestAsync, CreateRequest(HttpMethod.Get, uri, remoteServer.HttpVersion), HttpCompletionOption.ResponseHeadersRead)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this accomplishing? Shouldn't the client's DefaultRequestVersion
be the same as remoteServer.HttpVersion
here? HttpClient
does essentially the same thing as this CreateRequest
when you call GetAsync
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SendAsync|Send
ignores HttpClient.DefaultRequestVersion
since it accepts fully constructed request. The default initialization of HttpRequestMessage
will set it to 1.1. And because we plug in VersionChecker
set up with the remote server version, it will blow up for 2.0 servers.
If it's about why Send
versus Get
, then it's because we weren't testing decompression with sync code paths at all due to using GetAsync
(helpers didn't get sync overloads). And we had an error in missing overrides for decompression content 😞 So I changed the tests to use SendAsync|Send
instead and now we're testing both, sync and async.
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/JsonContent.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/DecompressionHandler.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http.Json/tests/FunctionalTests/TestClasses.cs
Outdated
Show resolved
Hide resolved
...es/System.Utf8String.Experimental/tests/System/Net/Http/Utf8StringContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
...es/System.Utf8String.Experimental/tests/System/Net/Http/Utf8StringContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
...es/System.Utf8String.Experimental/tests/System/Net/Http/Utf8StringContentTests.netcoreapp.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The product changes LGTM. I didn't review the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Adds missing overrides of sync
SerializeToStream
andCreateContentReadStream
to otherHttpContent
implementations in libraries.Fixes #37477
cc: @jozkee @GrabYourPitchforks @stephentoub @scalablecory