{"action":"created","comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments/87604984","pull_request_review_id":8213278,"id":87604984,"diff_hunk":"@@ -351,7 +351,18 @@ protected override void ProcessRecord()\n                     HttpResponseMessage response = GetResponse(client, request);\n                     response.EnsureSuccessStatusCode();\n \n-                    string contentType = ContentHelper.GetContentType(response);\n+                    //added try/catch due to possible lack of content type in the response header.\n+                    //seems the only reason we are getting it here is for a log message?\n+\n+                    string contentType = null;\n+                    try \n+                    { \n+                        ContentHelper.GetContentType(response);","path":"src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs","position":11,"original_position":11,"commit_id":"211573db52a1d2f81ddb53a156306b298614689e","original_commit_id":"211573db52a1d2f81ddb53a156306b298614689e","user":{"login":"iSazonov","id":22290914,"avatar_url":"https://avatars.githubusercontent.com/u/22290914?v=3","gravatar_id":"","url":"https://api.github.com/users/iSazonov","html_url":"https://github.com/iSazonov","followers_url":"https://api.github.com/users/iSazonov/followers","following_url":"https://api.github.com/users/iSazonov/following{/other_user}","gists_url":"https://api.github.com/users/iSazonov/gists{/gist_id}","starred_url":"https://api.github.com/users/iSazonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iSazonov/subscriptions","organizations_url":"https://api.github.com/users/iSazonov/orgs","repos_url":"https://api.github.com/users/iSazonov/repos","events_url":"https://api.github.com/users/iSazonov/events{/privacy}","received_events_url":"https://api.github.com/users/iSazonov/received_events","type":"User","site_admin":false},"body":"Maybe `contentType = ContentHelper.GetContentType(response); `","created_at":"2016-11-11T15:25:41Z","updated_at":"2016-11-11T15:30:18Z","html_url":"https://github.com/PowerShell/PowerShell/pull/2666#discussion_r87604984","pull_request_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/2666","_links":{"self":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments/87604984"},"html":{"href":"https://github.com/PowerShell/PowerShell/pull/2666#discussion_r87604984"},"pull_request":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/2666"}}},"pull_request":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/2666","id":93277251,"html_url":"https://github.com/PowerShell/PowerShell/pull/2666","diff_url":"https://github.com/PowerShell/PowerShell/pull/2666.diff","patch_url":"https://github.com/PowerShell/PowerShell/pull/2666.patch","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/2666","number":2666,"state":"open","locked":false,"title":"Fix WebRequest failure to handle missing ContentType in response header","user":{"login":"nmbradford","id":8855114,"avatar_url":"https://avatars.githubusercontent.com/u/8855114?v=3","gravatar_id":"","url":"https://api.github.com/users/nmbradford","html_url":"https://github.com/nmbradford","followers_url":"https://api.github.com/users/nmbradford/followers","following_url":"https://api.github.com/users/nmbradford/following{/other_user}","gists_url":"https://api.github.com/users/nmbradford/gists{/gist_id}","starred_url":"https://api.github.com/users/nmbradford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmbradford/subscriptions","organizations_url":"https://api.github.com/users/nmbradford/orgs","repos_url":"https://api.github.com/users/nmbradford/repos","events_url":"https://api.github.com/users/nmbradford/events{/privacy}","received_events_url":"https://api.github.com/users/nmbradford/received_events","type":"User","site_admin":false},"body":"If a response to invoke-webrequest does not set the content type in the\r\nresponse header, an object not set exception is thrown in\r\nWebResponseHelper.CoreClr.cs.  Updated to set contenttype = null.","created_at":"2016-11-11T04:21:49Z","updated_at":"2016-11-11T15:30:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68f41bf1a9e2f6a4047cc0f41003c61600249402","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/2666/commits","review_comments_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/2666/comments","review_comment_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/2666/comments","statuses_url":"https://api.github.com/repos/PowerShell/PowerShell/statuses/211573db52a1d2f81ddb53a156306b298614689e","head":{"label":"nmbradford:webrequestfix","ref":"webrequestfix","sha":"211573db52a1d2f81ddb53a156306b298614689e","user":{"login":"nmbradford","id":8855114,"avatar_url":"https://avatars.githubusercontent.com/u/8855114?v=3","gravatar_id":"","url":"https://api.github.com/users/nmbradford","html_url":"https://github.com/nmbradford","followers_url":"https://api.github.com/users/nmbradford/followers","following_url":"https://api.github.com/users/nmbradford/following{/other_user}","gists_url":"https://api.github.com/users/nmbradford/gists{/gist_id}","starred_url":"https://api.github.com/users/nmbradford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmbradford/subscriptions","organizations_url":"https://api.github.com/users/nmbradford/orgs","repos_url":"https://api.github.com/users/nmbradford/repos","events_url":"https://api.github.com/users/nmbradford/events{/privacy}","received_events_url":"https://api.github.com/users/nmbradford/received_events","type":"User","site_admin":false},"repo":{"id":73443108,"name":"PowerShell","full_name":"nmbradford/PowerShell","owner":{"login":"nmbradford","id":8855114,"avatar_url":"https://avatars.githubusercontent.com/u/8855114?v=3","gravatar_id":"","url":"https://api.github.com/users/nmbradford","html_url":"https://github.com/nmbradford","followers_url":"https://api.github.com/users/nmbradford/followers","following_url":"https://api.github.com/users/nmbradford/following{/other_user}","gists_url":"https://api.github.com/users/nmbradford/gists{/gist_id}","starred_url":"https://api.github.com/users/nmbradford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmbradford/subscriptions","organizations_url":"https://api.github.com/users/nmbradford/orgs","repos_url":"https://api.github.com/users/nmbradford/repos","events_url":"https://api.github.com/users/nmbradford/events{/privacy}","received_events_url":"https://api.github.com/users/nmbradford/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmbradford/PowerShell","description":"PowerShell for every system!","fork":true,"url":"https://api.github.com/repos/nmbradford/PowerShell","forks_url":"https://api.github.com/repos/nmbradford/PowerShell/forks","keys_url":"https://api.github.com/repos/nmbradford/PowerShell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmbradford/PowerShell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmbradford/PowerShell/teams","hooks_url":"https://api.github.com/repos/nmbradford/PowerShell/hooks","issue_events_url":"https://api.github.com/repos/nmbradford/PowerShell/issues/events{/number}","events_url":"https://api.github.com/repos/nmbradford/PowerShell/events","assignees_url":"https://api.github.com/repos/nmbradford/PowerShell/assignees{/user}","branches_url":"https://api.github.com/repos/nmbradford/PowerShell/branches{/branch}","tags_url":"https://api.github.com/repos/nmbradford/PowerShell/tags","blobs_url":"https://api.github.com/repos/nmbradford/PowerShell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmbradford/PowerShell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmbradford/PowerShell/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmbradford/PowerShell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmbradford/PowerShell/statuses/{sha}","languages_url":"https://api.github.com/repos/nmbradford/PowerShell/languages","stargazers_url":"https://api.github.com/repos/nmbradford/PowerShell/stargazers","contributors_url":"https://api.github.com/repos/nmbradford/PowerShell/contributors","subscribers_url":"https://api.github.com/repos/nmbradford/PowerShell/subscribers","subscription_url":"https://api.github.com/repos/nmbradford/PowerShell/subscription","commits_url":"https://api.github.com/repos/nmbradford/PowerShell/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmbradford/PowerShell/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmbradford/PowerShell/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmbradford/PowerShell/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmbradford/PowerShell/contents/{+path}","compare_url":"https://api.github.com/repos/nmbradford/PowerShell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmbradford/PowerShell/merges","archive_url":"https://api.github.com/repos/nmbradford/PowerShell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmbradford/PowerShell/downloads","issues_url":"https://api.github.com/repos/nmbradford/PowerShell/issues{/number}","pulls_url":"https://api.github.com/repos/nmbradford/PowerShell/pulls{/number}","milestones_url":"https://api.github.com/repos/nmbradford/PowerShell/milestones{/number}","notifications_url":"https://api.github.com/repos/nmbradford/PowerShell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmbradford/PowerShell/labels{/name}","releases_url":"https://api.github.com/repos/nmbradford/PowerShell/releases{/id}","deployments_url":"https://api.github.com/repos/nmbradford/PowerShell/deployments","created_at":"2016-11-11T03:36:33Z","updated_at":"2016-11-11T03:36:41Z","pushed_at":"2016-11-11T04:20:07Z","git_url":"git://github.com/nmbradford/PowerShell.git","ssh_url":"git@github.com:nmbradford/PowerShell.git","clone_url":"https://github.com/nmbradford/PowerShell.git","svn_url":"https://github.com/nmbradford/PowerShell","homepage":"https://microsoft.com/powershell","size":20828,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"PowerShell:master","ref":"master","sha":"b56bbeabc66dec9545839ff2c04c1a6807b1921c","user":{"login":"PowerShell","id":11524380,"avatar_url":"https://avatars.githubusercontent.com/u/11524380?v=3","gravatar_id":"","url":"https://api.github.com/users/PowerShell","html_url":"https://github.com/PowerShell","followers_url":"https://api.github.com/users/PowerShell/followers","following_url":"https://api.github.com/users/PowerShell/following{/other_user}","gists_url":"https://api.github.com/users/PowerShell/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerShell/subscriptions","organizations_url":"https://api.github.com/users/PowerShell/orgs","repos_url":"https://api.github.com/users/PowerShell/repos","events_url":"https://api.github.com/users/PowerShell/events{/privacy}","received_events_url":"https://api.github.com/users/PowerShell/received_events","type":"Organization","site_admin":false},"repo":{"id":49609581,"name":"PowerShell","full_name":"PowerShell/PowerShell","owner":{"login":"PowerShell","id":11524380,"avatar_url":"https://avatars.githubusercontent.com/u/11524380?v=3","gravatar_id":"","url":"https://api.github.com/users/PowerShell","html_url":"https://github.com/PowerShell","followers_url":"https://api.github.com/users/PowerShell/followers","following_url":"https://api.github.com/users/PowerShell/following{/other_user}","gists_url":"https://api.github.com/users/PowerShell/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerShell/subscriptions","organizations_url":"https://api.github.com/users/PowerShell/orgs","repos_url":"https://api.github.com/users/PowerShell/repos","events_url":"https://api.github.com/users/PowerShell/events{/privacy}","received_events_url":"https://api.github.com/users/PowerShell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PowerShell/PowerShell","description":"PowerShell for every system!","fork":false,"url":"https://api.github.com/repos/PowerShell/PowerShell","forks_url":"https://api.github.com/repos/PowerShell/PowerShell/forks","keys_url":"https://api.github.com/repos/PowerShell/PowerShell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PowerShell/PowerShell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PowerShell/PowerShell/teams","hooks_url":"https://api.github.com/repos/PowerShell/PowerShell/hooks","issue_events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/events{/number}","events_url":"https://api.github.com/repos/PowerShell/PowerShell/events","assignees_url":"https://api.github.com/repos/PowerShell/PowerShell/assignees{/user}","branches_url":"https://api.github.com/repos/PowerShell/PowerShell/branches{/branch}","tags_url":"https://api.github.com/repos/PowerShell/PowerShell/tags","blobs_url":"https://api.github.com/repos/PowerShell/PowerShell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PowerShell/PowerShell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PowerShell/PowerShell/git/refs{/sha}","trees_url":"https://api.github.com/repos/PowerShell/PowerShell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PowerShell/PowerShell/statuses/{sha}","languages_url":"https://api.github.com/repos/PowerShell/PowerShell/languages","stargazers_url":"https://api.github.com/repos/PowerShell/PowerShell/stargazers","contributors_url":"https://api.github.com/repos/PowerShell/PowerShell/contributors","subscribers_url":"https://api.github.com/repos/PowerShell/PowerShell/subscribers","subscription_url":"https://api.github.com/repos/PowerShell/PowerShell/subscription","commits_url":"https://api.github.com/repos/PowerShell/PowerShell/commits{/sha}","git_commits_url":"https://api.github.com/repos/PowerShell/PowerShell/git/commits{/sha}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/comments{/number}","issue_comment_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments{/number}","contents_url":"https://api.github.com/repos/PowerShell/PowerShell/contents/{+path}","compare_url":"https://api.github.com/repos/PowerShell/PowerShell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PowerShell/PowerShell/merges","archive_url":"https://api.github.com/repos/PowerShell/PowerShell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PowerShell/PowerShell/downloads","issues_url":"https://api.github.com/repos/PowerShell/PowerShell/issues{/number}","pulls_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls{/number}","milestones_url":"https://api.github.com/repos/PowerShell/PowerShell/milestones{/number}","notifications_url":"https://api.github.com/repos/PowerShell/PowerShell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/labels{/name}","releases_url":"https://api.github.com/repos/PowerShell/PowerShell/releases{/id}","deployments_url":"https://api.github.com/repos/PowerShell/PowerShell/deployments","created_at":"2016-01-13T23:41:35Z","updated_at":"2016-11-11T14:03:07Z","pushed_at":"2016-11-11T04:21:49Z","git_url":"git://github.com/PowerShell/PowerShell.git","ssh_url":"git@github.com:PowerShell/PowerShell.git","clone_url":"https://github.com/PowerShell/PowerShell.git","svn_url":"https://github.com/PowerShell/PowerShell","homepage":"https://microsoft.com/powershell","size":27248,"stargazers_count":5521,"watchers_count":5521,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":644,"mirror_url":null,"open_issues_count":469,"forks":644,"open_issues":469,"watchers":5521,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/2666"},"html":{"href":"https://github.com/PowerShell/PowerShell/pull/2666"},"issue":{"href":"https://api.github.com/repos/PowerShell/PowerShell/issues/2666"},"comments":{"href":"https://api.github.com/repos/PowerShell/PowerShell/issues/2666/comments"},"review_comments":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/2666/comments"},"review_comment":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/2666/commits"},"statuses":{"href":"https://api.github.com/repos/PowerShell/PowerShell/statuses/211573db52a1d2f81ddb53a156306b298614689e"}}}}
{"actor":{"display_login":"iSazonov"}}