Revert "Updating proxy to return 301 to add a "/" at the end for #4958"

This commit is contained in:
Daniel Smith
2015-03-27 15:59:40 -07:00
parent db189c0d4d
commit 93a82c30d9
2 changed files with 0 additions and 65 deletions

View File

@@ -191,15 +191,6 @@ func (r *ProxyHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
return
}
// Redirect requests of the form "/{resource}/{name}" to "/{resource}/{name}/"
// This is essentially a hack for https://github.com/GoogleCloudPlatform/kubernetes/issues/4958.
// Note: Keep this code after tryUpgrade to not break that flow.
if len(parts) == 2 && !strings.HasSuffix(req.URL.Path, "/") {
w.Header().Set("Location", req.URL.Path+"/")
w.WriteHeader(http.StatusMovedPermanently)
return
}
proxy := httputil.NewSingleHostReverseProxy(&url.URL{Scheme: location.Scheme, Host: location.Host})
if transport == nil {
prepend := path.Join(r.prefix, resource, id)