-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Multipart test failing in .NET Core #179
Comments
Work on #176 stops because nuget does not add PCL parget to final package. I am waiting. And I will see to this issue. |
I will continue working on issue. |
I think I found where From there I was able to disable chunking and fix the test by setting the content-length header explicitly. @kroniak Don't worry about this one - I don't think .NET Core is doing anything wrong here, and in fact the behavior is probably a good enhancement, so I doubt they'll revert it in a newer version. The real problem is a bug in library that httpbin depends on. Once that's fixed, I'll undo the above commit. It's probably good for a chunked upload to get tested anyway. I think they're just waiting on this PR to get merged. |
Appears to be working on httpbin now without my hack. |
RealHttpTests.can_post_multipart recently started failing in .NET Core. Since no code had changed related to this, I figured something must be broken with httpbin. But why only with .NET Core? I opened up Fiddler and had a look at the requests. The difference is immediately clear from the request headers:
Full framework:
.NET Core:
Aha! The .NET Core version is doing chunked encoding, the handling of which is indeed a recent regression bug with httpbin. I'm not sure why the 2 versions of HttpClient behave differently in this regard, but I figured turning off chunked encoding just for this test should at least work around the httpbin bug. But I haven't been able to figure out how to do that. Even if I set
HttpRequestMessage.Headers.TransferEncodingChunked
tofalse
immediately beforeSendAsync
of the inner handler is called, it doesn't stick. Something deep down inHttpClientHandler
is apparently deciding to chunk the request. You can see this by setting a breakpoint anywhere after the request is sent and observing thatTransferEncodingChunked
has been set to true.@kroniak I know you're working on changes for the next major version where we'll be targeting 1.1 and above only. Wondering if you can verify whether this chunking behavior still exists in 1.1, or if you have any other suggestions on what to do here?
The text was updated successfully, but these errors were encountered: