{"action":"created","comment":{"url":"https://api.github.com/repos/docker/distribution/pulls/comments/26808021","id":26808021,"diff_hunk":"@@ -11,178 +11,158 @@ import (\n \t\"github.com/docker/distribution/digest\"\n \t\"github.com/docker/distribution/manifest\"\n \t\"github.com/docker/distribution/registry/api/v2\"\n-\t\"github.com/gorilla/handlers\"\n \t\"golang.org/x/net/context\"\n )\n \n // imageManifestDispatcher takes the request context and builds the\n // appropriate handler for handling image manifest requests.\n-func imageManifestDispatcher(ctx *Context, r *http.Request) http.Handler {\n-\timageManifestHandler := &imageManifestHandler{\n-\t\tContext: ctx,\n-\t}\n-\treference := getReference(ctx)\n-\tdgst, err := digest.ParseDigest(reference)\n-\tif err != nil {\n-\t\t// We just have a tag\n-\t\timageManifestHandler.Tag = reference\n-\t} else {\n-\t\timageManifestHandler.Digest = dgst\n-\t}\n-\n-\treturn handlers.MethodHandler{\n-\t\t\"GET\":    http.HandlerFunc(imageManifestHandler.GetImageManifest),\n-\t\t\"PUT\":    http.HandlerFunc(imageManifestHandler.PutImageManifest),\n-\t\t\"DELETE\": http.HandlerFunc(imageManifestHandler.DeleteImageManifest),\n+func imageManifestHandler(ctx *Context, w http.ResponseWriter, r *http.Request) (httpErr *HTTPError) {\n+\tswitch r.Method {\n+\tcase \"GET\":\n+\t\thttpErr = GetImageManifest(ctx, w, r)\n+\tcase \"PUT\":\n+\t\thttpErr = PutImageManifest(ctx, w, r)\n+\tcase \"DELETE\":\n+\t\thttpErr = DeleteImageManifest(ctx, w, r)\n+\tdefault:\n+\t\tw.WriteHeader(http.StatusNotFound)","path":"registry/handlers/images.go","position":36,"original_position":36,"commit_id":"9543708b1dbfc90505194c193989b9a6356e98ca","original_commit_id":"9543708b1dbfc90505194c193989b9a6356e98ca","user":{"login":"stevvooe","id":120601,"avatar_url":"https://avatars.githubusercontent.com/u/120601?v=3","gravatar_id":"","url":"https://api.github.com/users/stevvooe","html_url":"https://github.com/stevvooe","followers_url":"https://api.github.com/users/stevvooe/followers","following_url":"https://api.github.com/users/stevvooe/following{/other_user}","gists_url":"https://api.github.com/users/stevvooe/gists{/gist_id}","starred_url":"https://api.github.com/users/stevvooe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevvooe/subscriptions","organizations_url":"https://api.github.com/users/stevvooe/orgs","repos_url":"https://api.github.com/users/stevvooe/repos","events_url":"https://api.github.com/users/stevvooe/events{/privacy}","received_events_url":"https://api.github.com/users/stevvooe/received_events","type":"User","site_admin":false},"body":"This should be `http.StatusMethodNotAllowed`.","created_at":"2015-03-19T23:27:28Z","updated_at":"2015-03-19T23:27:28Z","html_url":"https://github.com/docker/distribution/pull/282#discussion_r26808021","pull_request_url":"https://api.github.com/repos/docker/distribution/pulls/282","_links":{"self":{"href":"https://api.github.com/repos/docker/distribution/pulls/comments/26808021"},"html":{"href":"https://github.com/docker/distribution/pull/282#discussion_r26808021"},"pull_request":{"href":"https://api.github.com/repos/docker/distribution/pulls/282"}}},"pull_request":{"url":"https://api.github.com/repos/docker/distribution/pulls/282","id":31574861,"html_url":"https://github.com/docker/distribution/pull/282","diff_url":"https://github.com/docker/distribution/pull/282.diff","patch_url":"https://github.com/docker/distribution/pull/282.patch","issue_url":"https://api.github.com/repos/docker/distribution/issues/282","number":282,"state":"open","locked":false,"title":"handler/dispatcher refactor","user":{"login":"endophage","id":1302091,"avatar_url":"https://avatars.githubusercontent.com/u/1302091?v=3","gravatar_id":"","url":"https://api.github.com/users/endophage","html_url":"https://github.com/endophage","followers_url":"https://api.github.com/users/endophage/followers","following_url":"https://api.github.com/users/endophage/following{/other_user}","gists_url":"https://api.github.com/users/endophage/gists{/gist_id}","starred_url":"https://api.github.com/users/endophage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endophage/subscriptions","organizations_url":"https://api.github.com/users/endophage/orgs","repos_url":"https://api.github.com/users/endophage/repos","events_url":"https://api.github.com/users/endophage/events{/privacy}","received_events_url":"https://api.github.com/users/endophage/received_events","type":"User","site_admin":false},"body":"Major points:\r\n\r\n* Dispatchers no longer exist.\r\n* Simpler call path for handlers.\r\n* gorilla's MethodHandler no longer in use.\r\n* Errors more generically handled in a uniform way via HTTPError\r\n* A request Context no longer needs to embed App\r\n* The various handler structs are gone.\r\n\r\nSigned-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)","created_at":"2015-03-19T23:02:55Z","updated_at":"2015-03-19T23:27:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8011fe97590b05464c4003e38431910595f6088","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/distribution/pulls/282/commits","review_comments_url":"https://api.github.com/repos/docker/distribution/pulls/282/comments","review_comment_url":"https://api.github.com/repos/docker/distribution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/distribution/issues/282/comments","statuses_url":"https://api.github.com/repos/docker/distribution/statuses/9543708b1dbfc90505194c193989b9a6356e98ca","head":{"label":"endophage:handler_refactor","ref":"handler_refactor","sha":"9543708b1dbfc90505194c193989b9a6356e98ca","user":{"login":"endophage","id":1302091,"avatar_url":"https://avatars.githubusercontent.com/u/1302091?v=3","gravatar_id":"","url":"https://api.github.com/users/endophage","html_url":"https://github.com/endophage","followers_url":"https://api.github.com/users/endophage/followers","following_url":"https://api.github.com/users/endophage/following{/other_user}","gists_url":"https://api.github.com/users/endophage/gists{/gist_id}","starred_url":"https://api.github.com/users/endophage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endophage/subscriptions","organizations_url":"https://api.github.com/users/endophage/orgs","repos_url":"https://api.github.com/users/endophage/repos","events_url":"https://api.github.com/users/endophage/events{/privacy}","received_events_url":"https://api.github.com/users/endophage/received_events","type":"User","site_admin":false},"repo":{"id":31222916,"name":"distribution","full_name":"endophage/distribution","owner":{"login":"endophage","id":1302091,"avatar_url":"https://avatars.githubusercontent.com/u/1302091?v=3","gravatar_id":"","url":"https://api.github.com/users/endophage","html_url":"https://github.com/endophage","followers_url":"https://api.github.com/users/endophage/followers","following_url":"https://api.github.com/users/endophage/following{/other_user}","gists_url":"https://api.github.com/users/endophage/gists{/gist_id}","starred_url":"https://api.github.com/users/endophage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endophage/subscriptions","organizations_url":"https://api.github.com/users/endophage/orgs","repos_url":"https://api.github.com/users/endophage/repos","events_url":"https://api.github.com/users/endophage/events{/privacy}","received_events_url":"https://api.github.com/users/endophage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/endophage/distribution","description":"The Docker toolset to pack, ship, store, and deliver content","fork":true,"url":"https://api.github.com/repos/endophage/distribution","forks_url":"https://api.github.com/repos/endophage/distribution/forks","keys_url":"https://api.github.com/repos/endophage/distribution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/endophage/distribution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/endophage/distribution/teams","hooks_url":"https://api.github.com/repos/endophage/distribution/hooks","issue_events_url":"https://api.github.com/repos/endophage/distribution/issues/events{/number}","events_url":"https://api.github.com/repos/endophage/distribution/events","assignees_url":"https://api.github.com/repos/endophage/distribution/assignees{/user}","branches_url":"https://api.github.com/repos/endophage/distribution/branches{/branch}","tags_url":"https://api.github.com/repos/endophage/distribution/tags","blobs_url":"https://api.github.com/repos/endophage/distribution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/endophage/distribution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/endophage/distribution/git/refs{/sha}","trees_url":"https://api.github.com/repos/endophage/distribution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/endophage/distribution/statuses/{sha}","languages_url":"https://api.github.com/repos/endophage/distribution/languages","stargazers_url":"https://api.github.com/repos/endophage/distribution/stargazers","contributors_url":"https://api.github.com/repos/endophage/distribution/contributors","subscribers_url":"https://api.github.com/repos/endophage/distribution/subscribers","subscription_url":"https://api.github.com/repos/endophage/distribution/subscription","commits_url":"https://api.github.com/repos/endophage/distribution/commits{/sha}","git_commits_url":"https://api.github.com/repos/endophage/distribution/git/commits{/sha}","comments_url":"https://api.github.com/repos/endophage/distribution/comments{/number}","issue_comment_url":"https://api.github.com/repos/endophage/distribution/issues/comments{/number}","contents_url":"https://api.github.com/repos/endophage/distribution/contents/{+path}","compare_url":"https://api.github.com/repos/endophage/distribution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/endophage/distribution/merges","archive_url":"https://api.github.com/repos/endophage/distribution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/endophage/distribution/downloads","issues_url":"https://api.github.com/repos/endophage/distribution/issues{/number}","pulls_url":"https://api.github.com/repos/endophage/distribution/pulls{/number}","milestones_url":"https://api.github.com/repos/endophage/distribution/milestones{/number}","notifications_url":"https://api.github.com/repos/endophage/distribution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/endophage/distribution/labels{/name}","releases_url":"https://api.github.com/repos/endophage/distribution/releases{/id}","created_at":"2015-02-23T18:37:33Z","updated_at":"2015-03-19T22:50:22Z","pushed_at":"2015-03-19T23:03:12Z","git_url":"git://github.com/endophage/distribution.git","ssh_url":"git@github.com:endophage/distribution.git","clone_url":"https://github.com/endophage/distribution.git","svn_url":"https://github.com/endophage/distribution","homepage":null,"size":1857,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"docker:master","ref":"master","sha":"06fcf053e7b45aa8608c6bf32e8d3227b31d3747","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":28366058,"name":"distribution","full_name":"docker/distribution","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/distribution","description":"The Docker toolset to pack, ship, store, and deliver content","fork":false,"url":"https://api.github.com/repos/docker/distribution","forks_url":"https://api.github.com/repos/docker/distribution/forks","keys_url":"https://api.github.com/repos/docker/distribution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/distribution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/distribution/teams","hooks_url":"https://api.github.com/repos/docker/distribution/hooks","issue_events_url":"https://api.github.com/repos/docker/distribution/issues/events{/number}","events_url":"https://api.github.com/repos/docker/distribution/events","assignees_url":"https://api.github.com/repos/docker/distribution/assignees{/user}","branches_url":"https://api.github.com/repos/docker/distribution/branches{/branch}","tags_url":"https://api.github.com/repos/docker/distribution/tags","blobs_url":"https://api.github.com/repos/docker/distribution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/distribution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/distribution/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/distribution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/distribution/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/distribution/languages","stargazers_url":"https://api.github.com/repos/docker/distribution/stargazers","contributors_url":"https://api.github.com/repos/docker/distribution/contributors","subscribers_url":"https://api.github.com/repos/docker/distribution/subscribers","subscription_url":"https://api.github.com/repos/docker/distribution/subscription","commits_url":"https://api.github.com/repos/docker/distribution/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/distribution/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/distribution/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/distribution/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/distribution/contents/{+path}","compare_url":"https://api.github.com/repos/docker/distribution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/distribution/merges","archive_url":"https://api.github.com/repos/docker/distribution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/distribution/downloads","issues_url":"https://api.github.com/repos/docker/distribution/issues{/number}","pulls_url":"https://api.github.com/repos/docker/distribution/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/distribution/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/distribution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/distribution/labels{/name}","releases_url":"https://api.github.com/repos/docker/distribution/releases{/id}","created_at":"2014-12-22T23:49:26Z","updated_at":"2015-03-19T09:54:45Z","pushed_at":"2015-03-19T23:03:13Z","git_url":"git://github.com/docker/distribution.git","ssh_url":"git@github.com:docker/distribution.git","clone_url":"https://github.com/docker/distribution.git","svn_url":"https://github.com/docker/distribution","homepage":null,"size":4682,"stargazers_count":161,"watchers_count":161,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":90,"forks":42,"open_issues":90,"watchers":161,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/distribution/pulls/282"},"html":{"href":"https://github.com/docker/distribution/pull/282"},"issue":{"href":"https://api.github.com/repos/docker/distribution/issues/282"},"comments":{"href":"https://api.github.com/repos/docker/distribution/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/distribution/pulls/282/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/distribution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/distribution/pulls/282/commits"},"statuses":{"href":"https://api.github.com/repos/docker/distribution/statuses/9543708b1dbfc90505194c193989b9a6356e98ca"}}}}