{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/27332616","id":27332616,"diff_hunk":"@@ -367,3 +367,58 @@ func TestProxyUpgrade(t *testing.T) {\n \t\tt.Fatalf(\"expected '%#v', got '%#v'\", e, a)\n \t}\n }\n+\n+func TestRedirectOnMissingTrailingSlash(t *testing.T) {\n+\ttable := []struct {\n+\t\t// The requested path\n+\t\tpath string\n+\t\t// The path requested on the proxy server.\n+\t\tproxyServerPath string\n+\t}{\n+\t\t{\"/trailing/slash/\", \"/trailing/slash/\"},\n+\t\t{\"/\", \"/\"},\n+\t\t// \"/\" should be added at the end.\n+\t\t{\"\", \"/\"},\n+\t\t// \"/\" should not be added at a non-root path.\n+\t\t{\"/some/path\", \"/some/path\"},\n+\t}\n+\n+\tfor _, item := range table {\n+\t\tproxyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n+\t\t\tif req.URL.Path != item.proxyServerPath {\n+\t\t\t\tt.Errorf(\"Unexpected request on path: %s, expected path: %s, item: %v\", req.URL.Path, item.proxyServerPath, item)\n+\t\t\t}\n+\t\t}))\n+\t\tdefer proxyServer.Close()\n+\n+\t\tserverURL, _ := url.Parse(proxyServer.URL)\n+\t\tsimpleStorage := &SimpleRESTStorage{\n+\t\t\terrors:                    map[string]error{},\n+\t\t\tresourceLocation:          serverURL,\n+\t\t\texpectedResourceNamespace: \"ns\",\n+\t\t}\n+\n+\t\thandler := handleNamespaced(map[string]rest.Storage{\"foo\": simpleStorage})\n+\t\tserver := httptest.NewServer(handler)\n+\t\tdefer server.Close()\n+\n+\t\tproxyTestPattern := \"/api/version/proxy/namespaces/ns/foo/id\" + item.path\n+\t\treq, err := http.NewRequest(\n+\t\t\t\"GET\",\n+\t\t\tserver.URL+proxyTestPattern,\n+\t\t\tstrings.NewReader(\"\"),\n+\t\t)\n+\t\tif err != nil {\n+\t\t\tt.Errorf(\"unexpected error %v\", err)\n+\t\t\tcontinue\n+\t\t}\n+\t\tresp, err := http.DefaultClient.Do(req)","path":"pkg/apiserver/proxy_test.go","position":null,"original_position":49,"commit_id":"2fff606a6f16e69b05310a7f774acfb8235b2b7b","original_commit_id":"3e0b5375b952dd5ce8b5cc1d56ff46968c9641e5","user":{"login":"nikhiljindal","id":10199099,"avatar_url":"https://avatars.githubusercontent.com/u/10199099?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhiljindal","html_url":"https://github.com/nikhiljindal","followers_url":"https://api.github.com/users/nikhiljindal/followers","following_url":"https://api.github.com/users/nikhiljindal/following{/other_user}","gists_url":"https://api.github.com/users/nikhiljindal/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhiljindal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhiljindal/subscriptions","organizations_url":"https://api.github.com/users/nikhiljindal/orgs","repos_url":"https://api.github.com/users/nikhiljindal/repos","events_url":"https://api.github.com/users/nikhiljindal/events{/privacy}","received_events_url":"https://api.github.com/users/nikhiljindal/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2015-03-27T21:29:45Z","updated_at":"2015-03-27T21:29:45Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6048#discussion_r27332616","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6048","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/27332616"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6048#discussion_r27332616"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6048"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6048","id":32088785,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6048","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6048.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6048.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6048","number":6048,"state":"open","locked":false,"title":"Updating proxy to return 301 to add a \"/\" at the end for #4958","user":{"login":"nikhiljindal","id":10199099,"avatar_url":"https://avatars.githubusercontent.com/u/10199099?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhiljindal","html_url":"https://github.com/nikhiljindal","followers_url":"https://api.github.com/users/nikhiljindal/followers","following_url":"https://api.github.com/users/nikhiljindal/following{/other_user}","gists_url":"https://api.github.com/users/nikhiljindal/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhiljindal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhiljindal/subscriptions","organizations_url":"https://api.github.com/users/nikhiljindal/orgs","repos_url":"https://api.github.com/users/nikhiljindal/repos","events_url":"https://api.github.com/users/nikhiljindal/events{/privacy}","received_events_url":"https://api.github.com/users/nikhiljindal/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/GoogleCloudPlatform/kubernetes/issues/4958\r\n\r\ncc @vishh @satnam6502 ","created_at":"2015-03-27T07:49:41Z","updated_at":"2015-03-27T21:29:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c124dbdb373d86c88accd319fc78d32a7f1c0ead","assignee":{"login":"lavalamp","id":647318,"avatar_url":"https://avatars.githubusercontent.com/u/647318?v=3","gravatar_id":"","url":"https://api.github.com/users/lavalamp","html_url":"https://github.com/lavalamp","followers_url":"https://api.github.com/users/lavalamp/followers","following_url":"https://api.github.com/users/lavalamp/following{/other_user}","gists_url":"https://api.github.com/users/lavalamp/gists{/gist_id}","starred_url":"https://api.github.com/users/lavalamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavalamp/subscriptions","organizations_url":"https://api.github.com/users/lavalamp/orgs","repos_url":"https://api.github.com/users/lavalamp/repos","events_url":"https://api.github.com/users/lavalamp/events{/privacy}","received_events_url":"https://api.github.com/users/lavalamp/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6048/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6048/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6048/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/2fff606a6f16e69b05310a7f774acfb8235b2b7b","head":{"label":"nikhiljindal:proxy","ref":"proxy","sha":"2fff606a6f16e69b05310a7f774acfb8235b2b7b","user":{"login":"nikhiljindal","id":10199099,"avatar_url":"https://avatars.githubusercontent.com/u/10199099?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhiljindal","html_url":"https://github.com/nikhiljindal","followers_url":"https://api.github.com/users/nikhiljindal/followers","following_url":"https://api.github.com/users/nikhiljindal/following{/other_user}","gists_url":"https://api.github.com/users/nikhiljindal/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhiljindal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhiljindal/subscriptions","organizations_url":"https://api.github.com/users/nikhiljindal/orgs","repos_url":"https://api.github.com/users/nikhiljindal/repos","events_url":"https://api.github.com/users/nikhiljindal/events{/privacy}","received_events_url":"https://api.github.com/users/nikhiljindal/received_events","type":"User","site_admin":false},"repo":{"id":29988055,"name":"kubernetes","full_name":"nikhiljindal/kubernetes","owner":{"login":"nikhiljindal","id":10199099,"avatar_url":"https://avatars.githubusercontent.com/u/10199099?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhiljindal","html_url":"https://github.com/nikhiljindal","followers_url":"https://api.github.com/users/nikhiljindal/followers","following_url":"https://api.github.com/users/nikhiljindal/following{/other_user}","gists_url":"https://api.github.com/users/nikhiljindal/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhiljindal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhiljindal/subscriptions","organizations_url":"https://api.github.com/users/nikhiljindal/orgs","repos_url":"https://api.github.com/users/nikhiljindal/repos","events_url":"https://api.github.com/users/nikhiljindal/events{/privacy}","received_events_url":"https://api.github.com/users/nikhiljindal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nikhiljindal/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/nikhiljindal/kubernetes","forks_url":"https://api.github.com/repos/nikhiljindal/kubernetes/forks","keys_url":"https://api.github.com/repos/nikhiljindal/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikhiljindal/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikhiljindal/kubernetes/teams","hooks_url":"https://api.github.com/repos/nikhiljindal/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/nikhiljindal/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/nikhiljindal/kubernetes/events","assignees_url":"https://api.github.com/repos/nikhiljindal/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/nikhiljindal/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/nikhiljindal/kubernetes/tags","blobs_url":"https://api.github.com/repos/nikhiljindal/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikhiljindal/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikhiljindal/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikhiljindal/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikhiljindal/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/nikhiljindal/kubernetes/languages","stargazers_url":"https://api.github.com/repos/nikhiljindal/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/nikhiljindal/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/nikhiljindal/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/nikhiljindal/kubernetes/subscription","commits_url":"https://api.github.com/repos/nikhiljindal/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikhiljindal/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikhiljindal/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikhiljindal/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikhiljindal/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/nikhiljindal/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikhiljindal/kubernetes/merges","archive_url":"https://api.github.com/repos/nikhiljindal/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikhiljindal/kubernetes/downloads","issues_url":"https://api.github.com/repos/nikhiljindal/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/nikhiljindal/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/nikhiljindal/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/nikhiljindal/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikhiljindal/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/nikhiljindal/kubernetes/releases{/id}","created_at":"2015-01-28T21:01:50Z","updated_at":"2015-01-28T21:01:53Z","pushed_at":"2015-03-27T21:29:37Z","git_url":"git://github.com/nikhiljindal/kubernetes.git","ssh_url":"git@github.com:nikhiljindal/kubernetes.git","clone_url":"https://github.com/nikhiljindal/kubernetes.git","svn_url":"https://github.com/nikhiljindal/kubernetes","homepage":"http://kubernetes.io","size":39525,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"c9ad322ba97e448ddb462951821ab96c43ac6a96","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-03-27T21:19:21Z","pushed_at":"2015-03-27T21:29:38Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":"http://kubernetes.io","size":118232,"stargazers_count":6777,"watchers_count":6777,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1292,"mirror_url":null,"open_issues_count":824,"forks":1292,"open_issues":824,"watchers":6777,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6048"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/6048"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6048"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/6048/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6048/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/6048/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/2fff606a6f16e69b05310a7f774acfb8235b2b7b"}}}}