From 14838df51e3c9872e8c39d4efed5e8f70230fed9 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Mon, 23 Jun 2014 22:18:14 -0700 Subject: [PATCH] Update the proxy server. --- cmd/kubecfg/kubecfg.go | 6 ++++++ pkg/client/request.go | 1 + pkg/kubecfg/proxy_server.go | 2 ++ 3 files changed, 9 insertions(+) diff --git a/cmd/kubecfg/kubecfg.go b/cmd/kubecfg/kubecfg.go index 2358c95bbd5..4ebd4963fa8 100644 --- a/cmd/kubecfg/kubecfg.go +++ b/cmd/kubecfg/kubecfg.go @@ -130,6 +130,12 @@ func main() { } method := flag.Arg(0) + if len(flag.Args()) < 1 { + usage() + os.Exit(1) + } + method := flag.Arg(0) + matchFound := executeAPIRequest(method, auth) || executeControllerRequest(method, auth) if matchFound == false { glog.Fatalf("Unknown command %s", method) diff --git a/pkg/client/request.go b/pkg/client/request.go index ea643421433..e167d88cf48 100644 --- a/pkg/client/request.go +++ b/pkg/client/request.go @@ -234,3 +234,4 @@ func (r Result) Into(obj interface{}) error { func (r Result) Error() error { return r.err } + diff --git a/pkg/kubecfg/proxy_server.go b/pkg/kubecfg/proxy_server.go index 37ee056552f..94ead4c8de5 100644 --- a/pkg/kubecfg/proxy_server.go +++ b/pkg/kubecfg/proxy_server.go @@ -71,5 +71,7 @@ func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { s.doError(w, err) return } + w.WriteHeader(http.StatusOK) + w.Header().Add("Content-type", "application/json") w.Write(data) }