{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/comments/90098729","pull_request_review_id":10621547,"id":90098729,"diff_hunk":"@@ -198,14 +199,254 @@ internal static bool AreEqualCollections<T>(ICollection<T> x, ICollection<T> y,\n             return current;\n         }\n \n+        /// <summary>\n+        /// Try to find a target header value among the set of given header values and parse it as a\n+        /// <see cref=\"TimeSpan\"/>.\n+        /// </summary>\n+        /// <param name=\"headerValues\">\n+        /// The <see cref=\"StringValues\"/> containing the set of header values to search.\n+        /// </param>\n+        /// <param name=\"targetValue\">\n+        /// The target header value to look for.\n+        /// </param>\n+        /// <param name=\"value\">\n+        /// When this method returns, contains the parsed <see cref=\"TimeSpan\"/>, if the parsing succeeded, or\n+        /// null if the parsing failed. The conversion fails if the <paramref name=\"targetValue\"/> was not\n+        /// found or could not be parsed as a <see cref=\"TimeSpan\"/>. This parameter is passed uninitialized;\n+        /// any value originally supplied in result will be overwritten.\n+        /// </param>\n+        /// <returns>\n+        /// <code>true</code> if <paramref name=\"targetValue\"/> is found and successfully parsed; otherwise,\n+        /// <code>false</code>.\n+        /// </returns>\n+        // e.g. { \"headerValue=10, targetHeaderValue=30\" }\n+        public static bool TryParseTimeSpan(StringValues headerValues, string targetValue, out TimeSpan? value)\n+        {\n+            for (var i = 0; i < headerValues.Count; i++)\n+            {\n+                var headerValue = headerValues[i];\n+\n+                var index = headerValue.IndexOf(targetValue, StringComparison.OrdinalIgnoreCase);\n+                if (index != -1)\n+                {\n+                    index += targetValue.Length;\n+                    long seconds;\n+                    if (!TryParseInt64FromHeaderValue(index, headerValue, out seconds))\n+                    {\n+                        break;\n+                    }\n+                    value = TimeSpan.FromSeconds(seconds);\n+                    return true;\n+                }\n+            }\n+            value = null;\n+            return false;\n+        }\n+\n+        /// <summary>\n+        /// Check if a target header value exists among the set of given header values.\n+        /// </summary>\n+        /// <param name=\"headerValues\">\n+        /// The <see cref=\"StringValues\"/> containing the set of header values to search.\n+        /// </param>\n+        /// <param name=\"targetValue\">\n+        /// The target header value to look for.\n+        /// </param>\n+        /// <returns>\n+        /// <code>true</code> if <paramref name=\"targetValue\"/> is contained in <paramref name=\"headerValues\"/>;\n+        /// otherwise, <code>false</code>.\n+        /// </returns>\n+        public static bool Contains(StringValues headerValues, string targetValue)\n+        {\n+            for (var i = 0; i < headerValues.Count; i++)\n+            {\n+                var index = headerValues[i].IndexOf(targetValue, StringComparison.OrdinalIgnoreCase);","path":"src/Microsoft.Net.Http.Headers/HeaderUtilities.cs","position":73,"original_position":73,"commit_id":"270cf93dd9c85e4eec3e20cd397355fb44283aa0","original_commit_id":"270cf93dd9c85e4eec3e20cd397355fb44283aa0","user":{"login":"Tratcher","id":1821173,"avatar_url":"https://avatars.githubusercontent.com/u/1821173?v=3","gravatar_id":"","url":"https://api.github.com/users/Tratcher","html_url":"https://github.com/Tratcher","followers_url":"https://api.github.com/users/Tratcher/followers","following_url":"https://api.github.com/users/Tratcher/following{/other_user}","gists_url":"https://api.github.com/users/Tratcher/gists{/gist_id}","starred_url":"https://api.github.com/users/Tratcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tratcher/subscriptions","organizations_url":"https://api.github.com/users/Tratcher/orgs","repos_url":"https://api.github.com/users/Tratcher/repos","events_url":"https://api.github.com/users/Tratcher/events{/privacy}","received_events_url":"https://api.github.com/users/Tratcher/received_events","type":"User","site_admin":false},"body":"This will give you false positives for partial matches","created_at":"2016-11-29T19:56:46Z","updated_at":"2016-11-29T19:56:46Z","html_url":"https://github.com/aspnet/HttpAbstractions/pull/738#discussion_r90098729","pull_request_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/738","_links":{"self":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/comments/90098729"},"html":{"href":"https://github.com/aspnet/HttpAbstractions/pull/738#discussion_r90098729"},"pull_request":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/738"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/738","id":94877273,"html_url":"https://github.com/aspnet/HttpAbstractions/pull/738","diff_url":"https://github.com/aspnet/HttpAbstractions/pull/738.diff","patch_url":"https://github.com/aspnet/HttpAbstractions/pull/738.patch","issue_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/738","number":738,"state":"open","locked":false,"title":"HeaderUtilities enhancements","user":{"login":"JunTaoLuo","id":2030323,"avatar_url":"https://avatars.githubusercontent.com/u/2030323?v=3","gravatar_id":"","url":"https://api.github.com/users/JunTaoLuo","html_url":"https://github.com/JunTaoLuo","followers_url":"https://api.github.com/users/JunTaoLuo/followers","following_url":"https://api.github.com/users/JunTaoLuo/following{/other_user}","gists_url":"https://api.github.com/users/JunTaoLuo/gists{/gist_id}","starred_url":"https://api.github.com/users/JunTaoLuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JunTaoLuo/subscriptions","organizations_url":"https://api.github.com/users/JunTaoLuo/orgs","repos_url":"https://api.github.com/users/JunTaoLuo/repos","events_url":"https://api.github.com/users/JunTaoLuo/events{/privacy}","received_events_url":"https://api.github.com/users/JunTaoLuo/received_events","type":"User","site_admin":false},"body":"#737 \r\n\r\ncc @BrennanConroy @Tratcher ","created_at":"2016-11-22T19:03:31Z","updated_at":"2016-11-29T20:01:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ade9a7b65221bdae0d0e47daf9c31c5667ff95ca","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/738/commits","review_comments_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/738/comments","review_comment_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/738/comments","statuses_url":"https://api.github.com/repos/aspnet/HttpAbstractions/statuses/270cf93dd9c85e4eec3e20cd397355fb44283aa0","head":{"label":"aspnet:johluo/header-utilities","ref":"johluo/header-utilities","sha":"270cf93dd9c85e4eec3e20cd397355fb44283aa0","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":15320915,"name":"HttpAbstractions","full_name":"aspnet/HttpAbstractions","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/HttpAbstractions","description":"HTTP abstractions such as HttpRequest, HttpResponse, and HttpContext, as well as common web utilities.","fork":false,"url":"https://api.github.com/repos/aspnet/HttpAbstractions","forks_url":"https://api.github.com/repos/aspnet/HttpAbstractions/forks","keys_url":"https://api.github.com/repos/aspnet/HttpAbstractions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/HttpAbstractions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/HttpAbstractions/teams","hooks_url":"https://api.github.com/repos/aspnet/HttpAbstractions/hooks","issue_events_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/HttpAbstractions/events","assignees_url":"https://api.github.com/repos/aspnet/HttpAbstractions/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/HttpAbstractions/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/HttpAbstractions/tags","blobs_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/HttpAbstractions/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/HttpAbstractions/languages","stargazers_url":"https://api.github.com/repos/aspnet/HttpAbstractions/stargazers","contributors_url":"https://api.github.com/repos/aspnet/HttpAbstractions/contributors","subscribers_url":"https://api.github.com/repos/aspnet/HttpAbstractions/subscribers","subscription_url":"https://api.github.com/repos/aspnet/HttpAbstractions/subscription","commits_url":"https://api.github.com/repos/aspnet/HttpAbstractions/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/HttpAbstractions/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/HttpAbstractions/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/HttpAbstractions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/HttpAbstractions/merges","archive_url":"https://api.github.com/repos/aspnet/HttpAbstractions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/HttpAbstractions/downloads","issues_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/HttpAbstractions/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/HttpAbstractions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/HttpAbstractions/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/HttpAbstractions/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/HttpAbstractions/deployments","created_at":"2013-12-19T19:38:45Z","updated_at":"2016-11-25T02:06:20Z","pushed_at":"2016-11-23T23:58:13Z","git_url":"git://github.com/aspnet/HttpAbstractions.git","ssh_url":"git@github.com:aspnet/HttpAbstractions.git","clone_url":"https://github.com/aspnet/HttpAbstractions.git","svn_url":"https://github.com/aspnet/HttpAbstractions","homepage":"","size":4059,"stargazers_count":187,"watchers_count":187,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":64,"forks":99,"open_issues":64,"watchers":187,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"d95f32219af4673320a5a16d9ccc5cdd83ebef7f","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":15320915,"name":"HttpAbstractions","full_name":"aspnet/HttpAbstractions","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/HttpAbstractions","description":"HTTP abstractions such as HttpRequest, HttpResponse, and HttpContext, as well as common web utilities.","fork":false,"url":"https://api.github.com/repos/aspnet/HttpAbstractions","forks_url":"https://api.github.com/repos/aspnet/HttpAbstractions/forks","keys_url":"https://api.github.com/repos/aspnet/HttpAbstractions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/HttpAbstractions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/HttpAbstractions/teams","hooks_url":"https://api.github.com/repos/aspnet/HttpAbstractions/hooks","issue_events_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/HttpAbstractions/events","assignees_url":"https://api.github.com/repos/aspnet/HttpAbstractions/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/HttpAbstractions/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/HttpAbstractions/tags","blobs_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/HttpAbstractions/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/HttpAbstractions/languages","stargazers_url":"https://api.github.com/repos/aspnet/HttpAbstractions/stargazers","contributors_url":"https://api.github.com/repos/aspnet/HttpAbstractions/contributors","subscribers_url":"https://api.github.com/repos/aspnet/HttpAbstractions/subscribers","subscription_url":"https://api.github.com/repos/aspnet/HttpAbstractions/subscription","commits_url":"https://api.github.com/repos/aspnet/HttpAbstractions/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/HttpAbstractions/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/HttpAbstractions/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/HttpAbstractions/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/HttpAbstractions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/HttpAbstractions/merges","archive_url":"https://api.github.com/repos/aspnet/HttpAbstractions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/HttpAbstractions/downloads","issues_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/HttpAbstractions/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/HttpAbstractions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/HttpAbstractions/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/HttpAbstractions/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/HttpAbstractions/deployments","created_at":"2013-12-19T19:38:45Z","updated_at":"2016-11-25T02:06:20Z","pushed_at":"2016-11-23T23:58:13Z","git_url":"git://github.com/aspnet/HttpAbstractions.git","ssh_url":"git@github.com:aspnet/HttpAbstractions.git","clone_url":"https://github.com/aspnet/HttpAbstractions.git","svn_url":"https://github.com/aspnet/HttpAbstractions","homepage":"","size":4059,"stargazers_count":187,"watchers_count":187,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":64,"forks":99,"open_issues":64,"watchers":187,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/738"},"html":{"href":"https://github.com/aspnet/HttpAbstractions/pull/738"},"issue":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/738"},"comments":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/738/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/738/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/738/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/statuses/270cf93dd9c85e4eec3e20cd397355fb44283aa0"}}}}
{"actor":{"display_login":"Tratcher"}}