{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/comments/42542530","id":42542530,"diff_hunk":"@@ -0,0 +1,326 @@\n+﻿// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+\n+using System;\n+using System.Text;\n+\n+namespace Microsoft.Extensions.WebEncoders\n+{\n+    /// <summary>\n+    /// UrlPathDecoder unescape a given path string.\n+    /// </summary>\n+    public class UrlPathDecoder\n+    {\n+        private static Lazy<Encoding> _utf8 = new Lazy<Encoding>(() =>\n+        {\n+            return Encoding.GetEncoding(\n+                \"utf-8\",\n+                new EncoderExceptionFallback(),\n+                new DecoderExceptionFallback());\n+        }, isThreadSafe: true);","path":"src/Microsoft.Extensions.WebEncoders.Core/UrlPathDecoder.cs","position":20,"original_position":20,"commit_id":"f8e08cfe75ef5804ab0f2206365c49f83910e7e6","original_commit_id":"f8e08cfe75ef5804ab0f2206365c49f83910e7e6","user":{"login":"troydai","id":1329240,"avatar_url":"https://avatars.githubusercontent.com/u/1329240?v=3","gravatar_id":"","url":"https://api.github.com/users/troydai","html_url":"https://github.com/troydai","followers_url":"https://api.github.com/users/troydai/followers","following_url":"https://api.github.com/users/troydai/following{/other_user}","gists_url":"https://api.github.com/users/troydai/gists{/gist_id}","starred_url":"https://api.github.com/users/troydai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troydai/subscriptions","organizations_url":"https://api.github.com/users/troydai/orgs","repos_url":"https://api.github.com/users/troydai/repos","events_url":"https://api.github.com/users/troydai/events{/privacy}","received_events_url":"https://api.github.com/users/troydai/received_events","type":"User","site_admin":false},"body":"I'll change to a `static`. Looks like a over-optimization. The chance that over the lifespan of a server nothing escaped in URL is rare.","created_at":"2015-10-20T19:34:34Z","updated_at":"2015-10-20T19:34:34Z","html_url":"https://github.com/aspnet/HttpAbstractions/pull/448#discussion_r42542530","pull_request_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/448","_links":{"self":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/comments/42542530"},"html":{"href":"https://github.com/aspnet/HttpAbstractions/pull/448#discussion_r42542530"},"pull_request":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/448"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/448","id":48167027,"html_url":"https://github.com/aspnet/HttpAbstractions/pull/448","diff_url":"https://github.com/aspnet/HttpAbstractions/pull/448.diff","patch_url":"https://github.com/aspnet/HttpAbstractions/pull/448.patch","issue_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/448","number":448,"state":"open","locked":false,"title":"Url Path Decoder","user":{"login":"troydai","id":1329240,"avatar_url":"https://avatars.githubusercontent.com/u/1329240?v=3","gravatar_id":"","url":"https://api.github.com/users/troydai","html_url":"https://github.com/troydai","followers_url":"https://api.github.com/users/troydai/followers","following_url":"https://api.github.com/users/troydai/following{/other_user}","gists_url":"https://api.github.com/users/troydai/gists{/gist_id}","starred_url":"https://api.github.com/users/troydai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troydai/subscriptions","organizations_url":"https://api.github.com/users/troydai/orgs","repos_url":"https://api.github.com/users/troydai/repos","events_url":"https://api.github.com/users/troydai/events{/privacy}","received_events_url":"https://api.github.com/users/troydai/received_events","type":"User","site_admin":false},"body":"Addressing: https://github.com/aspnet/KestrelHttpServer/issues/124\r\n/cc @Tratcher @blowdart @lodejard \r\n\r\nNote:\r\n- Unescaping every thing except `/`. `%2F` will be leave in the string.\r\n- If a sequence can't be correctly decoded under UTF8, just leave them as is.\r\n- Supposed to be O(n). Need more performance testing to prove.\r\n- Still working on more tests.\r\n- More performance tuning will happen as result of performance test.\r\n- Also, I'm looking at a change to potentially decode the string in place without allocate a new char array.\r\n- Also, need security review.","created_at":"2015-10-20T07:52:53Z","updated_at":"2015-10-20T19:34:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad6e50c565cda505c3fd912c4d64a2d966abddc7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/448/commits","review_comments_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/448/comments","review_comment_url":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/448/comments","statuses_url":"https://api.github.com/repos/aspnet/HttpAbstractions/statuses/f8e08cfe75ef5804ab0f2206365c49f83910e7e6","head":{"label":"aspnet:trdai/kes124","ref":"trdai/kes124","sha":"f8e08cfe75ef5804ab0f2206365c49f83910e7e6","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}","created_at":"2013-12-19T19:38:45Z","updated_at":"2015-10-16T15:30:13Z","pushed_at":"2015-10-20T18:28:26Z","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":5462,"stargazers_count":114,"watchers_count":114,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":44,"forks":53,"open_issues":44,"watchers":114,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"7ed6a6cb578ca9a18c44751acca2257d752c0699","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}","created_at":"2013-12-19T19:38:45Z","updated_at":"2015-10-16T15:30:13Z","pushed_at":"2015-10-20T18:28:26Z","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":5462,"stargazers_count":114,"watchers_count":114,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":44,"forks":53,"open_issues":44,"watchers":114,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/448"},"html":{"href":"https://github.com/aspnet/HttpAbstractions/pull/448"},"issue":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/448"},"comments":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/issues/448/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/448/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/pulls/448/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/HttpAbstractions/statuses/f8e08cfe75ef5804ab0f2206365c49f83910e7e6"}}}}