mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-23 13:35:38 +03:00
Merge: * /control/stats: set Content-Type: application/json
Close #1086 * commit '8985faa95d5414393165097fde032c02ff560b32': * minor * /control/stats: set Content-Type: application/json
This commit is contained in:
commit
c70389eb30
1 changed files with 5 additions and 12 deletions
|
@ -41,6 +41,7 @@ func (s *statsCtx) handleStats(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write(data)
|
||||
}
|
||||
|
||||
|
@ -94,16 +95,8 @@ func (s *statsCtx) initWeb() {
|
|||
return
|
||||
}
|
||||
|
||||
s.conf.HTTPRegister("GET", "/control/stats", func(w http.ResponseWriter, r *http.Request) {
|
||||
s.handleStats(w, r)
|
||||
})
|
||||
s.conf.HTTPRegister("POST", "/control/stats_reset", func(w http.ResponseWriter, r *http.Request) {
|
||||
s.handleStatsReset(w, r)
|
||||
})
|
||||
s.conf.HTTPRegister("POST", "/control/stats_config", func(w http.ResponseWriter, r *http.Request) {
|
||||
s.handleStatsConfig(w, r)
|
||||
})
|
||||
s.conf.HTTPRegister("GET", "/control/stats_info", func(w http.ResponseWriter, r *http.Request) {
|
||||
s.handleStatsInfo(w, r)
|
||||
})
|
||||
s.conf.HTTPRegister("GET", "/control/stats", s.handleStats)
|
||||
s.conf.HTTPRegister("POST", "/control/stats_reset", s.handleStatsReset)
|
||||
s.conf.HTTPRegister("POST", "/control/stats_config", s.handleStatsConfig)
|
||||
s.conf.HTTPRegister("GET", "/control/stats_info", s.handleStatsInfo)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue