Issue Description
When a URL (non-existing) is ask for and the url path is not valid UTF-8 this handler crashes, when setting a label value:
GET /%C0%AE%C0%AE/%C0%AE%C0%AE/WEB-INF/web.xml?
[INFO ] [PANIC RECOVER] label value "/../../WEB-INF/web.xml\xc0\x80.jsp" is not valid UTF-8 goroutine 132000 [running]:
Checklist
- [ x] Dependencies installed
- [ x] No typos
- [ x] Searched existing issues and docs
Expected behaviour
Not crash the handler.
Actual behaviour
Oct 05 07:59:52 godzilla dhz[576]: [INFO ] [PANIC RECOVER] label value "/../../WEB-INF/web.xml\xc0\x80.jsp" is not valid UTF-8 goroutine 132000 [running]:
Oct 05 07:59:52 godzilla dhz[576]: main.main.Recover.RecoverWithConfig.func9.1.1()
Oct 05 07:59:52 godzilla dhz[576]: /go/pkg/mod/github.com/labstack/echo/v4@v4.12.0/middleware/recover.go:99 +0x165
Oct 05 07:59:52 godzilla dhz[576]: panic({0xbc5280?, 0xc000f4bb40?})
Oct 05 07:59:52 godzilla dhz[576]: /usr/local/go/src/runtime/panic.go:770 +0x132
Oct 05 07:59:52 godzilla dhz[576]: github.com/prometheus/client_golang/prometheus.(*HistogramVec).WithLabelValues(...)
Oct 05 07:59:52 godzilla dhz[576]: /go/pkg/mod/github.com/prometheus/client_golang@v1.19.0/prometheus/histogram.go:1200
Oct 05 07:59:52 godzilla dhz[576]: github.com/labstack/echo-contrib/echoprometheus.MiddlewareConfig.ToMiddleware.func3.1({0xf9dd00, 0xc0003106e0})
Oct 05 07:59:52 godzilla dhz[576]: /go/pkg/mod/github.com/labstack/echo-contrib@v0.17.0/echoprometheus/prometheus.go:279 +0x7a5
Oct 05 07:59:52 godzilla dhz[576]: main.main.func2.1({0xf9dd00, 0xc0003106e0})
Steps to reproduce
Working code to debug
package main
func main() {
}
Version/commit
github.com/labstack/echo-contrib v0.17.0 (I'm probably somewhat behind here)
Prolly should use Skipper to avoid certain URLs, or validating the path before handing over to the prom handler.
Issue Description
When a URL (non-existing) is ask for and the url path is not valid UTF-8 this handler crashes, when setting a label value:
GET /%C0%AE%C0%AE/%C0%AE%C0%AE/WEB-INF/web.xml?[INFO ] [PANIC RECOVER] label value "/../../WEB-INF/web.xml\xc0\x80.jsp" is not valid UTF-8 goroutine 132000 [running]:Checklist
Expected behaviour
Not crash the handler.
Actual behaviour
Steps to reproduce
Working code to debug
Version/commit
github.com/labstack/echo-contrib v0.17.0(I'm probably somewhat behind here)Prolly should use
Skipperto avoid certain URLs, or validating the path before handing over to the prom handler.