middleware: equalize lengths of input (#1934)

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
bobby 2021-02-23 08:31:17 -08:00 committed by GitHub
parent e56fb38cb5
commit 9c7958b66f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 24 deletions

View file

@ -6,6 +6,7 @@ import (
"github.com/pomerium/pomerium/internal/httputil"
"github.com/pomerium/pomerium/internal/log"
"github.com/pomerium/pomerium/internal/middleware"
"github.com/pomerium/pomerium/internal/telemetry"
"github.com/pomerium/pomerium/internal/telemetry/metrics"
)
@ -89,7 +90,7 @@ func (mgr *MetricsManager) updateServer(cfg *Config) {
}
if username, password, ok := cfg.Options.GetMetricsBasicAuth(); ok {
handler = httputil.RequireBasicAuth(handler, username, password)
handler = middleware.RequireBasicAuth(username, password)(handler)
}
mgr.srv, err = httputil.NewServer(&httputil.ServerOptions{