From 8f39244ad12e47121324f881b9caa651d8d7e85f Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 10 Nov 2016 19:18:10 +0100 Subject: return actual http status code on error diff --git a/src/rhctl/web.go b/src/rhctl/web.go index c83a28e..2c5094c 100644 --- a/src/rhctl/web.go +++ b/src/rhctl/web.go @@ -54,7 +54,7 @@ type webError struct { } func webSendErrorResponse(w http.ResponseWriter, status int, error string) { - webSendResponse(w, http.StatusOK, webError{ResponseCode: status, ErrorString: error}) + webSendResponse(w, status, webError{ResponseCode: status, ErrorString: error}) } func webGetStateHandler(ctrl *SwitchControl, w http.ResponseWriter, r *http.Request) { @@ -87,7 +87,7 @@ func WebInit(conf *Config, ctrl *SwitchControl) (web *WebInterface) { web = &WebInterface{} if conf.Clients.Web.StaticDir != "" { - rhdl.Printf("Web: will serving static files from '%s'", conf.Clients.Web.StaticDir) + rhdl.Printf("Web: serving static files from '%s'", conf.Clients.Web.StaticDir) http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir(conf.Clients.Web.StaticDir)))) } http.Handle("/socket", webHandler{ctrl, webSocketHandler}) -- cgit v0.10.2