Skip to content
This repository was archived by the owner on Dec 7, 2020. It is now read-only.

Commit 08ed4a8

Browse files
Ivan Porto CarreroFrederic BIDON
authored andcommitted
remove logging from admin handler
Signed-off-by: Ivan Porto Carrero <ivan@oneconcern.com>
1 parent d306b5c commit 08ed4a8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func newDefaultConfig() *Config {
3131
if name, err := os.Hostname(); err == nil {
3232
hostnames = append(hostnames, name)
3333
}
34-
hostnames = append(hostnames, []string{"localhost", "127.0.0.1"}...)
34+
hostnames = append(hostnames, []string{"localhost", "127.0.0.1", "::1"}...)
3535

3636
return &Config{
3737
AccessTokenDuration: time.Duration(720) * time.Hour,

server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ func (r *oauthProxy) createReverseProxy() error {
250250
// mount admin and debug engines separately
251251
r.log.Info("mounting admin endpoints on separate listener")
252252
admin := chi.NewRouter()
253-
r.useDefaultStack(admin)
253+
admin.MethodNotAllowed(emptyHandler)
254+
admin.NotFound(emptyHandler)
255+
admin.Use(middleware.Recoverer)
254256
admin.Use(proxyDenyMiddleware)
255257
admin.Route("/", func(e chi.Router) {
256258
e.Mount(r.config.OAuthURI, adminEngine)

0 commit comments

Comments
 (0)