Update the proxy server.

This commit is contained in:
Brendan Burns 2014-06-23 22:18:14 -07:00
parent 1ddc012b17
commit 14838df51e
3 changed files with 9 additions and 0 deletions

View File

@ -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)

View File

@ -234,3 +234,4 @@ func (r Result) Into(obj interface{}) error {
func (r Result) Error() error {
return r.err
}

View File

@ -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)
}