{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/wcf/pulls/comments/32802304","id":32802304,"diff_hunk":"@@ -564,32 +548,56 @@ public HttpClientChannelAsyncRequest(HttpClientRequestChannel channel)\n                         if (_channel.State != CommunicationState.Opened)\n                         {\n                             // if we were aborted while getting our request or doing correlation, \n-                            // we need to abort the web request and bail\n+                            // we need to abort the request and bail\n                             Cleanup();\n                             _channel.ThrowIfDisposedOrNotOpen();\n                         }\n \n-                        HttpOutput httpOutput = HttpOutput.CreateHttpOutput(_httpRequestMessage, _factory, request, _factory.IsChannelBindingSupportEnabled, _factory.GetHttpClient(), _factory._authenticationScheme, _timeoutHelper);\n+                        bool suppressEntityBody = PrepareMessageHeaders(request);\n \n+                        if (!suppressEntityBody)\n+                        {\n+                            _httpRequestMessage.Content = MessageContent.Create(_factory, request, _timeoutHelper);\n+                        }\n+\n+                        await SendPreauthenticationHeadRequestIfNeeded();\n                         bool success = false;","path":"src/System.Private.ServiceModel/src/System/ServiceModel/Channels/HttpChannelFactory.cs","position":null,"original_position":148,"commit_id":"79df385f65b510c21b636f2b2063f1e38fa138cf","original_commit_id":"8fa89e6c05e298f3eda3142ef13a340717b24fa9","user":{"login":"iamjasonp","id":1616847,"avatar_url":"https://avatars.githubusercontent.com/u/1616847?v=3","gravatar_id":"","url":"https://api.github.com/users/iamjasonp","html_url":"https://github.com/iamjasonp","followers_url":"https://api.github.com/users/iamjasonp/followers","following_url":"https://api.github.com/users/iamjasonp/following{/other_user}","gists_url":"https://api.github.com/users/iamjasonp/gists{/gist_id}","starred_url":"https://api.github.com/users/iamjasonp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamjasonp/subscriptions","organizations_url":"https://api.github.com/users/iamjasonp/orgs","repos_url":"https://api.github.com/users/iamjasonp/repos","events_url":"https://api.github.com/users/iamjasonp/events{/privacy}","received_events_url":"https://api.github.com/users/iamjasonp/received_events","type":"User","site_admin":false},"body":"If this is the case, would we be in a situation where the HEAD would be rejected, the POST would work, and we'd have to re-POST? Would that just be handled? ","created_at":"2015-06-19T05:24:11Z","updated_at":"2015-06-19T05:24:11Z","html_url":"https://github.com/dotnet/wcf/pull/102#discussion_r32802304","pull_request_url":"https://api.github.com/repos/dotnet/wcf/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/comments/32802304"},"html":{"href":"https://github.com/dotnet/wcf/pull/102#discussion_r32802304"},"pull_request":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/wcf/pulls/102","id":37956559,"html_url":"https://github.com/dotnet/wcf/pull/102","diff_url":"https://github.com/dotnet/wcf/pull/102.diff","patch_url":"https://github.com/dotnet/wcf/pull/102.patch","issue_url":"https://api.github.com/repos/dotnet/wcf/issues/102","number":102,"state":"open","locked":false,"title":"Fix ability to replay http content as well as code cleanup","user":{"login":"mconnew","id":8648390,"avatar_url":"https://avatars.githubusercontent.com/u/8648390?v=3","gravatar_id":"","url":"https://api.github.com/users/mconnew","html_url":"https://github.com/mconnew","followers_url":"https://api.github.com/users/mconnew/followers","following_url":"https://api.github.com/users/mconnew/following{/other_user}","gists_url":"https://api.github.com/users/mconnew/gists{/gist_id}","starred_url":"https://api.github.com/users/mconnew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mconnew/subscriptions","organizations_url":"https://api.github.com/users/mconnew/orgs","repos_url":"https://api.github.com/users/mconnew/repos","events_url":"https://api.github.com/users/mconnew/events{/privacy}","received_events_url":"https://api.github.com/users/mconnew/received_events","type":"User","site_admin":false},"body":"We couldn't replay the HttpContent because of the way the ForwardingStream worked. This caused problems with digest authentication as pre-authentication isn't possible with WinHttp (the http client behind the corefx implementation of HttpClient).  This is achieved with a new MessageContent class which encapsulates a WCF Message and can write directly to a stream provided by HttpClient multiple times.\r\nCode cleanup allows easier error handling and extending the error cases in future changes. The send and receive code paths are separated more cleanly. This wasn't possible before because of the HttpOutput/HttpInput abstraction we were dealing with which was inherited from Desktop code. The net change is a reduction of around 700 lines of code.\r\nFixes #48, #6 and #5  ","created_at":"2015-06-17T23:03:44Z","updated_at":"2015-06-19T05:24:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b3f5c839fee70592766d3d103ed957c73763b06","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/wcf/pulls/102/commits","review_comments_url":"https://api.github.com/repos/dotnet/wcf/pulls/102/comments","review_comment_url":"https://api.github.com/repos/dotnet/wcf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/wcf/issues/102/comments","statuses_url":"https://api.github.com/repos/dotnet/wcf/statuses/79df385f65b510c21b636f2b2063f1e38fa138cf","head":{"label":"mconnew:http-authentication","ref":"http-authentication","sha":"79df385f65b510c21b636f2b2063f1e38fa138cf","user":{"login":"mconnew","id":8648390,"avatar_url":"https://avatars.githubusercontent.com/u/8648390?v=3","gravatar_id":"","url":"https://api.github.com/users/mconnew","html_url":"https://github.com/mconnew","followers_url":"https://api.github.com/users/mconnew/followers","following_url":"https://api.github.com/users/mconnew/following{/other_user}","gists_url":"https://api.github.com/users/mconnew/gists{/gist_id}","starred_url":"https://api.github.com/users/mconnew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mconnew/subscriptions","organizations_url":"https://api.github.com/users/mconnew/orgs","repos_url":"https://api.github.com/users/mconnew/repos","events_url":"https://api.github.com/users/mconnew/events{/privacy}","received_events_url":"https://api.github.com/users/mconnew/received_events","type":"User","site_admin":false},"repo":{"id":35959856,"name":"wcf","full_name":"mconnew/wcf","owner":{"login":"mconnew","id":8648390,"avatar_url":"https://avatars.githubusercontent.com/u/8648390?v=3","gravatar_id":"","url":"https://api.github.com/users/mconnew","html_url":"https://github.com/mconnew","followers_url":"https://api.github.com/users/mconnew/followers","following_url":"https://api.github.com/users/mconnew/following{/other_user}","gists_url":"https://api.github.com/users/mconnew/gists{/gist_id}","starred_url":"https://api.github.com/users/mconnew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mconnew/subscriptions","organizations_url":"https://api.github.com/users/mconnew/orgs","repos_url":"https://api.github.com/users/mconnew/repos","events_url":"https://api.github.com/users/mconnew/events{/privacy}","received_events_url":"https://api.github.com/users/mconnew/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mconnew/wcf","description":"This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.","fork":true,"url":"https://api.github.com/repos/mconnew/wcf","forks_url":"https://api.github.com/repos/mconnew/wcf/forks","keys_url":"https://api.github.com/repos/mconnew/wcf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mconnew/wcf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mconnew/wcf/teams","hooks_url":"https://api.github.com/repos/mconnew/wcf/hooks","issue_events_url":"https://api.github.com/repos/mconnew/wcf/issues/events{/number}","events_url":"https://api.github.com/repos/mconnew/wcf/events","assignees_url":"https://api.github.com/repos/mconnew/wcf/assignees{/user}","branches_url":"https://api.github.com/repos/mconnew/wcf/branches{/branch}","tags_url":"https://api.github.com/repos/mconnew/wcf/tags","blobs_url":"https://api.github.com/repos/mconnew/wcf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mconnew/wcf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mconnew/wcf/git/refs{/sha}","trees_url":"https://api.github.com/repos/mconnew/wcf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mconnew/wcf/statuses/{sha}","languages_url":"https://api.github.com/repos/mconnew/wcf/languages","stargazers_url":"https://api.github.com/repos/mconnew/wcf/stargazers","contributors_url":"https://api.github.com/repos/mconnew/wcf/contributors","subscribers_url":"https://api.github.com/repos/mconnew/wcf/subscribers","subscription_url":"https://api.github.com/repos/mconnew/wcf/subscription","commits_url":"https://api.github.com/repos/mconnew/wcf/commits{/sha}","git_commits_url":"https://api.github.com/repos/mconnew/wcf/git/commits{/sha}","comments_url":"https://api.github.com/repos/mconnew/wcf/comments{/number}","issue_comment_url":"https://api.github.com/repos/mconnew/wcf/issues/comments{/number}","contents_url":"https://api.github.com/repos/mconnew/wcf/contents/{+path}","compare_url":"https://api.github.com/repos/mconnew/wcf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mconnew/wcf/merges","archive_url":"https://api.github.com/repos/mconnew/wcf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mconnew/wcf/downloads","issues_url":"https://api.github.com/repos/mconnew/wcf/issues{/number}","pulls_url":"https://api.github.com/repos/mconnew/wcf/pulls{/number}","milestones_url":"https://api.github.com/repos/mconnew/wcf/milestones{/number}","notifications_url":"https://api.github.com/repos/mconnew/wcf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mconnew/wcf/labels{/name}","releases_url":"https://api.github.com/repos/mconnew/wcf/releases{/id}","created_at":"2015-05-20T16:24:51Z","updated_at":"2015-05-20T16:24:53Z","pushed_at":"2015-06-19T03:50:26Z","git_url":"git://github.com/mconnew/wcf.git","ssh_url":"git@github.com:mconnew/wcf.git","clone_url":"https://github.com/mconnew/wcf.git","svn_url":"https://github.com/mconnew/wcf","homepage":"","size":1178,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"ce2cfcb74b106b29f0a90dcbc5db17fa1a322884","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":35562993,"name":"wcf","full_name":"dotnet/wcf","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/wcf","description":"This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.","fork":false,"url":"https://api.github.com/repos/dotnet/wcf","forks_url":"https://api.github.com/repos/dotnet/wcf/forks","keys_url":"https://api.github.com/repos/dotnet/wcf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/wcf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/wcf/teams","hooks_url":"https://api.github.com/repos/dotnet/wcf/hooks","issue_events_url":"https://api.github.com/repos/dotnet/wcf/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/wcf/events","assignees_url":"https://api.github.com/repos/dotnet/wcf/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/wcf/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/wcf/tags","blobs_url":"https://api.github.com/repos/dotnet/wcf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/wcf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/wcf/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/wcf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/wcf/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/wcf/languages","stargazers_url":"https://api.github.com/repos/dotnet/wcf/stargazers","contributors_url":"https://api.github.com/repos/dotnet/wcf/contributors","subscribers_url":"https://api.github.com/repos/dotnet/wcf/subscribers","subscription_url":"https://api.github.com/repos/dotnet/wcf/subscription","commits_url":"https://api.github.com/repos/dotnet/wcf/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/wcf/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/wcf/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/wcf/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/wcf/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/wcf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/wcf/merges","archive_url":"https://api.github.com/repos/dotnet/wcf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/wcf/downloads","issues_url":"https://api.github.com/repos/dotnet/wcf/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/wcf/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/wcf/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/wcf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/wcf/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/wcf/releases{/id}","created_at":"2015-05-13T17:17:03Z","updated_at":"2015-06-18T05:19:09Z","pushed_at":"2015-06-19T04:03:43Z","git_url":"git://github.com/dotnet/wcf.git","ssh_url":"git@github.com:dotnet/wcf.git","clone_url":"https://github.com/dotnet/wcf.git","svn_url":"https://github.com/dotnet/wcf","homepage":"","size":1893,"stargazers_count":457,"watchers_count":457,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":127,"mirror_url":null,"open_issues_count":60,"forks":127,"open_issues":60,"watchers":457,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/102"},"html":{"href":"https://github.com/dotnet/wcf/pull/102"},"issue":{"href":"https://api.github.com/repos/dotnet/wcf/issues/102"},"comments":{"href":"https://api.github.com/repos/dotnet/wcf/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/wcf/statuses/79df385f65b510c21b636f2b2063f1e38fa138cf"}}}}