{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/StaticFiles/pulls/comments/22961001","id":22961001,"diff_hunk":"@@ -218,44 +215,38 @@ private void ComputeRange()\n                 return;\n             }\n \n-            string rangeHeader = _request.Headers.Get(Constants.Range);\n-            IList<Tuple<long?, long?>> ranges;\n-            if (!RangeHelpers.TryParseRanges(rangeHeader, out ranges))\n+            var rangeHeader = _requestHeaders.Range;\n+            if (rangeHeader == null)\n             {\n                 return;\n             }\n \n-            if (ranges.Count > 1)\n+            if (rangeHeader.Ranges.Count > 1)\n             {\n-                // multiple range headers not yet supported\n-                _logger.WriteWarning(\"Multiple range headers not yet supported, {0} ranges in header\", ranges.Count.ToString());\n+                _logger.WriteWarning(\"Multiple ranges not yet supported: '{0}'\", rangeHeader.ToString());","path":"src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs","position":159,"original_position":159,"commit_id":"6e84fd9a4dd1017325c1b16bf4805dd5b2c95f90","original_commit_id":"6e84fd9a4dd1017325c1b16bf4805dd5b2c95f90","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 was a specific choice to avoid potential exploits around requests for strange ranges (e.g. each byte individually, etc..). It's not considered a failure scenario because the spec says that the server should ignore any range headers it does not understand/support and process the response normally.\r\n\r\nI'll make the comment more detailed.","created_at":"2015-01-14T19:09:05Z","updated_at":"2015-01-14T19:09:05Z","html_url":"https://github.com/aspnet/StaticFiles/pull/24#discussion_r22961001","pull_request_url":"https://api.github.com/repos/aspnet/StaticFiles/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/aspnet/StaticFiles/pulls/comments/22961001"},"html":{"href":"https://github.com/aspnet/StaticFiles/pull/24#discussion_r22961001"},"pull_request":{"href":"https://api.github.com/repos/aspnet/StaticFiles/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/StaticFiles/pulls/24","id":27288279,"html_url":"https://github.com/aspnet/StaticFiles/pull/24","diff_url":"https://github.com/aspnet/StaticFiles/pull/24.diff","patch_url":"https://github.com/aspnet/StaticFiles/pull/24.patch","issue_url":"https://api.github.com/repos/aspnet/StaticFiles/issues/24","number":24,"state":"open","locked":false,"title":"Strongly Typed Headers","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":"Use the new strongly typed headers to simplify the static files code. This primarily affects range requests.\r\n\r\nRelated:\r\n#18 Send the Accept-Ranges header.\r\nhttps://github.com/aspnet/HttpAbstractions/pull/164 - New header types\r\n\r\n@muratg @davidfowl @loudej @GrabYourPitchforks","created_at":"2015-01-13T17:24:41Z","updated_at":"2015-01-14T19:09:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9026905f685e669cc74cb783f0b07c6b8e117508","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/StaticFiles/pulls/24/commits","review_comments_url":"https://api.github.com/repos/aspnet/StaticFiles/pulls/24/comments","review_comment_url":"https://api.github.com/repos/aspnet/StaticFiles/pulls/comments/{number}","comments_url":"https://api.github.com/repos/aspnet/StaticFiles/issues/24/comments","statuses_url":"https://api.github.com/repos/aspnet/StaticFiles/statuses/6e84fd9a4dd1017325c1b16bf4805dd5b2c95f90","head":{"label":"aspnet:Headers","ref":"Headers","sha":"6e84fd9a4dd1017325c1b16bf4805dd5b2c95f90","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":16554141,"name":"StaticFiles","full_name":"aspnet/StaticFiles","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/StaticFiles","description":"Middleware for handling requests for file system resources including files and directories.","fork":false,"url":"https://api.github.com/repos/aspnet/StaticFiles","forks_url":"https://api.github.com/repos/aspnet/StaticFiles/forks","keys_url":"https://api.github.com/repos/aspnet/StaticFiles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/StaticFiles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/StaticFiles/teams","hooks_url":"https://api.github.com/repos/aspnet/StaticFiles/hooks","issue_events_url":"https://api.github.com/repos/aspnet/StaticFiles/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/StaticFiles/events","assignees_url":"https://api.github.com/repos/aspnet/StaticFiles/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/StaticFiles/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/StaticFiles/tags","blobs_url":"https://api.github.com/repos/aspnet/StaticFiles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/StaticFiles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/StaticFiles/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/StaticFiles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/StaticFiles/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/StaticFiles/languages","stargazers_url":"https://api.github.com/repos/aspnet/StaticFiles/stargazers","contributors_url":"https://api.github.com/repos/aspnet/StaticFiles/contributors","subscribers_url":"https://api.github.com/repos/aspnet/StaticFiles/subscribers","subscription_url":"https://api.github.com/repos/aspnet/StaticFiles/subscription","commits_url":"https://api.github.com/repos/aspnet/StaticFiles/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/StaticFiles/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/StaticFiles/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/StaticFiles/issues/comments/{number}","contents_url":"https://api.github.com/repos/aspnet/StaticFiles/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/StaticFiles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/StaticFiles/merges","archive_url":"https://api.github.com/repos/aspnet/StaticFiles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/StaticFiles/downloads","issues_url":"https://api.github.com/repos/aspnet/StaticFiles/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/StaticFiles/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/StaticFiles/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/StaticFiles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/StaticFiles/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/StaticFiles/releases{/id}","created_at":"2014-02-05T18:38:58Z","updated_at":"2015-01-06T22:16:57Z","pushed_at":"2015-01-13T19:09:04Z","git_url":"git://github.com/aspnet/StaticFiles.git","ssh_url":"git@github.com:aspnet/StaticFiles.git","clone_url":"https://github.com/aspnet/StaticFiles.git","svn_url":"https://github.com/aspnet/StaticFiles","homepage":"","size":747,"stargazers_count":23,"watchers_count":23,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":4,"forks":14,"open_issues":4,"watchers":23,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"82be0d3d4abd6c52002f27356454ce14096b33cf","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":16554141,"name":"StaticFiles","full_name":"aspnet/StaticFiles","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/StaticFiles","description":"Middleware for handling requests for file system resources including files and directories.","fork":false,"url":"https://api.github.com/repos/aspnet/StaticFiles","forks_url":"https://api.github.com/repos/aspnet/StaticFiles/forks","keys_url":"https://api.github.com/repos/aspnet/StaticFiles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/StaticFiles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/StaticFiles/teams","hooks_url":"https://api.github.com/repos/aspnet/StaticFiles/hooks","issue_events_url":"https://api.github.com/repos/aspnet/StaticFiles/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/StaticFiles/events","assignees_url":"https://api.github.com/repos/aspnet/StaticFiles/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/StaticFiles/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/StaticFiles/tags","blobs_url":"https://api.github.com/repos/aspnet/StaticFiles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/StaticFiles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/StaticFiles/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/StaticFiles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/StaticFiles/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/StaticFiles/languages","stargazers_url":"https://api.github.com/repos/aspnet/StaticFiles/stargazers","contributors_url":"https://api.github.com/repos/aspnet/StaticFiles/contributors","subscribers_url":"https://api.github.com/repos/aspnet/StaticFiles/subscribers","subscription_url":"https://api.github.com/repos/aspnet/StaticFiles/subscription","commits_url":"https://api.github.com/repos/aspnet/StaticFiles/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/StaticFiles/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/StaticFiles/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/StaticFiles/issues/comments/{number}","contents_url":"https://api.github.com/repos/aspnet/StaticFiles/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/StaticFiles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/StaticFiles/merges","archive_url":"https://api.github.com/repos/aspnet/StaticFiles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/StaticFiles/downloads","issues_url":"https://api.github.com/repos/aspnet/StaticFiles/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/StaticFiles/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/StaticFiles/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/StaticFiles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/StaticFiles/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/StaticFiles/releases{/id}","created_at":"2014-02-05T18:38:58Z","updated_at":"2015-01-06T22:16:57Z","pushed_at":"2015-01-13T19:09:04Z","git_url":"git://github.com/aspnet/StaticFiles.git","ssh_url":"git@github.com:aspnet/StaticFiles.git","clone_url":"https://github.com/aspnet/StaticFiles.git","svn_url":"https://github.com/aspnet/StaticFiles","homepage":"","size":747,"stargazers_count":23,"watchers_count":23,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":4,"forks":14,"open_issues":4,"watchers":23,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/StaticFiles/pulls/24"},"html":{"href":"https://github.com/aspnet/StaticFiles/pull/24"},"issue":{"href":"https://api.github.com/repos/aspnet/StaticFiles/issues/24"},"comments":{"href":"https://api.github.com/repos/aspnet/StaticFiles/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/StaticFiles/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/StaticFiles/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/aspnet/StaticFiles/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/StaticFiles/statuses/6e84fd9a4dd1017325c1b16bf4805dd5b2c95f90"}}}}