diff --git a/go.mod b/go.mod index 40620e7..d0c60ac 100644 --- a/go.mod +++ b/go.mod @@ -12,12 +12,11 @@ require ( github.com/docker/cli v0.0.0-20191105005515-99c5edceb48d github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker v17.12.0-ce-rc1.0.20191113042239-ea84732a7725+incompatible // indirect - github.com/docker/docker-credential-helpers v0.6.3 // indirect github.com/docker/go-units v0.4.0 github.com/gorilla/mux v1.8.0 github.com/morikuni/aec v1.0.0 github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 - github.com/openfaas/faas-provider v0.19.0 + github.com/openfaas/faas-provider v0.19.1 github.com/openfaas/faas/gateway v0.0.0-20220509091830-4e868f5f9d81 github.com/pkg/errors v0.9.1 github.com/sethvargo/go-password v0.2.0 @@ -40,6 +39,7 @@ require ( github.com/containerd/ttrpc v1.1.0 // indirect github.com/containerd/typeurl v1.0.2 // indirect github.com/containernetworking/cni v1.1.1 // indirect + github.com/docker/docker-credential-helpers v0.6.3 // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect github.com/gogo/googleapis v1.4.0 // indirect diff --git a/go.sum b/go.sum index a93394b..5825b23 100644 --- a/go.sum +++ b/go.sum @@ -652,8 +652,8 @@ github.com/opencontainers/selinux v1.10.1 h1:09LIPVRP3uuZGQvgR+SgMSNBd1Eb3vlRbGq github.com/opencontainers/selinux v1.10.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/openfaas/faas-provider v0.18.6/go.mod h1:fq1JL0mX4rNvVVvRLaLRJ3H6o667sHuyP5p/7SZEe98= github.com/openfaas/faas-provider v0.18.7/go.mod h1:S217qfIaMrv+XKJxgbhBzJzCfyFvoIF+BvYdDo6XIDQ= -github.com/openfaas/faas-provider v0.19.0 h1:1dv4HDkWa9/yVkUll23/06y9lf8+tISOxYoHwBXZaJI= -github.com/openfaas/faas-provider v0.19.0/go.mod h1:Farrp+9Med8LeK3aoYpqplMP8f5ebTILbCSLg2LPLZk= +github.com/openfaas/faas-provider v0.19.1 h1:xH8lTWabfDZwzIvC0u1AO48ghD3BNw6Vo231DLqTeI0= +github.com/openfaas/faas-provider v0.19.1/go.mod h1:Farrp+9Med8LeK3aoYpqplMP8f5ebTILbCSLg2LPLZk= github.com/openfaas/faas/gateway v0.0.0-20220509091830-4e868f5f9d81 h1:vWFZEznP2EbynX0uMygpFLAmKwv2uUAdCABnjARr7Wo= github.com/openfaas/faas/gateway v0.0.0-20220509091830-4e868f5f9d81/go.mod h1:EFFnEVTvUdC9Bulh6rcKIq6e+XwDCG106gVzLKcj/+M= github.com/openfaas/nats-queue-worker v0.0.0-20210726161954-ada9a31504c9/go.mod h1:ajlN2z+D8JPBq3kWNv4WLT6mtKPqlgeE3dYEx39d1tk= diff --git a/vendor/github.com/openfaas/faas-provider/httputil/write_interceptor.go b/vendor/github.com/openfaas/faas-provider/httputil/write_interceptor.go index 99141ba..9806e61 100644 --- a/vendor/github.com/openfaas/faas-provider/httputil/write_interceptor.go +++ b/vendor/github.com/openfaas/faas-provider/httputil/write_interceptor.go @@ -12,14 +12,14 @@ func NewHttpWriteInterceptor(w http.ResponseWriter) *HttpWriteInterceptor { type HttpWriteInterceptor struct { http.ResponseWriter - StatusCode int + statusCode int } func (c *HttpWriteInterceptor) Status() int { - if c.StatusCode == 0 { + if c.statusCode == 0 { return http.StatusOK } - return c.StatusCode + return c.statusCode } func (c *HttpWriteInterceptor) Header() http.Header { @@ -27,11 +27,14 @@ func (c *HttpWriteInterceptor) Header() http.Header { } func (c *HttpWriteInterceptor) Write(data []byte) (int, error) { + if c.statusCode == 0 { + c.WriteHeader(http.StatusOK) + } return c.ResponseWriter.Write(data) } func (c *HttpWriteInterceptor) WriteHeader(code int) { - c.StatusCode = code + c.statusCode = code c.ResponseWriter.WriteHeader(code) } diff --git a/vendor/github.com/openfaas/faas-provider/metrics.go b/vendor/github.com/openfaas/faas-provider/metrics.go index 0b8d749..cfd130a 100644 --- a/vendor/github.com/openfaas/faas-provider/metrics.go +++ b/vendor/github.com/openfaas/faas-provider/metrics.go @@ -53,7 +53,7 @@ func (hm *httpMetrics) InstrumentHandler(next http.Handler, pathOverride string) defer func() { hm.RequestsTotal.With( - prometheus.Labels{"code": strconv.Itoa(ww.StatusCode), + prometheus.Labels{"code": strconv.Itoa(ww.Status()), "method": r.Method, "path": path, }). @@ -62,7 +62,7 @@ func (hm *httpMetrics) InstrumentHandler(next http.Handler, pathOverride string) defer func() { hm.RequestDurationHistogram.With( - prometheus.Labels{"code": strconv.Itoa(ww.StatusCode), + prometheus.Labels{"code": strconv.Itoa(ww.Status()), "method": r.Method, "path": path, }). diff --git a/vendor/modules.txt b/vendor/modules.txt index 2847670..8ce8a75 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -255,7 +255,7 @@ github.com/opencontainers/selinux/go-selinux github.com/opencontainers/selinux/go-selinux/label github.com/opencontainers/selinux/pkg/pwalk github.com/opencontainers/selinux/pkg/pwalkdir -# github.com/openfaas/faas-provider v0.19.0 +# github.com/openfaas/faas-provider v0.19.1 ## explicit; go 1.17 github.com/openfaas/faas-provider github.com/openfaas/faas-provider/auth