feat(api, gui): allow authentication bypass for metrics (#10045)
### Purpose
Give the ability to skip authentication for prometheus metrics
("/metrics").
### Testing
When authentication is enabled and "Metrics Without Auth" is checked
(not the default), the "/metrics" path remains accessible even when
disconnected.
### Screenshots

### Documentation
https://github.com/syncthing/docs/pull/906
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@ func (m *csrfManager) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if isNoAuthPath(r.URL.Path) {
|
||||
if isNoAuthPath(r.URL.Path, false) {
|
||||
// REST calls that don't require authentication also do not
|
||||
// need a CSRF token.
|
||||
m.next.ServeHTTP(w, r)
|
||||
|
||||
Reference in New Issue
Block a user