Skip to content

Commit

Permalink
[FIX] security pprof endpoint being exposed, second try
Browse files Browse the repository at this point in the history
  • Loading branch information
sergivb01 committed Jun 2, 2020
1 parent 840fc19 commit f297bb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/mcserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net"
"net/http"
// only used when debug is enabled in config
_ "net/http/pprof"
_ "net/http/pprof" // #nosec
"os"
"time"

Expand Down Expand Up @@ -79,7 +79,7 @@ func (s MCServer) Start(ctx context.Context) error {
if s.cfg.Debug {
go func() {
s.log.Info().Str("listenAddress", "localhost:6060").Msg("listening for http pprof")
if err := http.ListenAndServe("localhost:6060", nil); err != nil {
if err := http.ListenAndServe("localhost:6060", nil); err != nil { // #nosec G108
s.log.Fatal().Err(err).Msg("listening http for pprof")
}
}()
Expand Down

0 comments on commit f297bb4

Please sign in to comment.