-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add option to hide /debug/ pages #8596
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ type Config struct { | |
LogEnabled bool `toml:"log-enabled"` | ||
WriteTracing bool `toml:"write-tracing"` | ||
PprofEnabled bool `toml:"pprof-enabled"` | ||
DebugEnabled bool `toml:"debug-enabled"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default for this should be set to |
||
HTTPSEnabled bool `toml:"https-enabled"` | ||
HTTPSCertificate string `toml:"https-certificate"` | ||
HTTPSPrivateKey string `toml:"https-private-key"` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,9 +256,9 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
|
||
if strings.HasPrefix(r.URL.Path, "/debug/pprof") && h.Config.PprofEnabled { | ||
h.handleProfiles(w, r) | ||
} else if strings.HasPrefix(r.URL.Path, "/debug/vars") { | ||
} else if strings.HasPrefix(r.URL.Path, "/debug/vars") && h.Config.DebugEnabled { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that is what |
||
h.serveExpvar(w, r) | ||
} else if strings.HasPrefix(r.URL.Path, "/debug/requests") { | ||
} else if strings.HasPrefix(r.URL.Path, "/debug/requests") && h.Config.DebugEnabled { | ||
h.serveDebugRequests(w, r) | ||
} else { | ||
h.mux.ServeHTTP(w, r) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be updated to
debug-enabled
rather thanpprof-enabled
.