diff --git a/proxy/proxy.go b/proxy/proxy.go index 4ca099f..8cf1888 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -137,7 +137,7 @@ func proxyRequest(w http.ResponseWriter, originalReq *http.Request, proxyClient pathVars := mux.Vars(originalReq) functionName := pathVars["name"] if functionName == "" { - w.Header().Add("x-openfaas-internal", "proxy") + w.Header().Add("X-OpenFaaS-Internal", "proxy") httputil.Errorf(w, http.StatusBadRequest, "Provide function name in the request path") return @@ -145,7 +145,7 @@ func proxyRequest(w http.ResponseWriter, originalReq *http.Request, proxyClient functionAddr, err := resolver.Resolve(functionName) if err != nil { - w.Header().Add("x-openfaas-internal", "proxy") + w.Header().Add("X-OpenFaaS-Internal", "proxy") // TODO: Should record the 404/not found error in Prometheus. log.Printf("resolver error: no endpoints for %s: %s\n", functionName, err.Error()) @@ -156,7 +156,7 @@ func proxyRequest(w http.ResponseWriter, originalReq *http.Request, proxyClient proxyReq, err := buildProxyRequest(originalReq, functionAddr, pathVars["params"]) if err != nil { - w.Header().Add("x-openfaas-internal", "proxy") + w.Header().Add("X-OpenFaaS-Internal", "proxy") httputil.Errorf(w, http.StatusInternalServerError, "Failed to resolve service: %s.", functionName) return @@ -173,7 +173,7 @@ func proxyRequest(w http.ResponseWriter, originalReq *http.Request, proxyClient if err != nil { log.Printf("error with proxy request to: %s, %s\n", proxyReq.URL.String(), err.Error()) - w.Header().Add("x-openfaas-internal", "proxy") + w.Header().Add("X-OpenFaaS-Internal", "proxy") httputil.Errorf(w, http.StatusInternalServerError, "Can't reach service for: %s.", functionName) return