cluster: standardize default HTTP responses (#4368)

Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
Roman Khavronenko 2023-06-01 10:26:52 +02:00 committed by GitHub
parent 6c84b61893
commit 576e59d82c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -192,7 +192,10 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
if r.Method != http.MethodGet {
return false
}
fmt.Fprintf(w, "vminsert - a component of VictoriaMetrics cluster. See docs at https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html")
w.Header().Add("Content-Type", "text/html; charset=utf-8")
fmt.Fprintf(w, `vminsert - a component of VictoriaMetrics cluster<br/>
<a href="https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html">docs</a><br>
`)
return true
}
p, err := httpserver.ParsePath(r.URL.Path)

View File

@ -182,6 +182,7 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
if r.Method != http.MethodGet {
return false
}
w.Header().Add("Content-Type", "text/html; charset=utf-8")
fmt.Fprintf(w, `vmselect - a component of VictoriaMetrics cluster<br/>
<a href="https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html">docs</a><br>
`)

View File

@ -163,7 +163,10 @@ func newRequestHandler(strg *storage.Storage) httpserver.RequestHandler {
if r.Method != http.MethodGet {
return false
}
fmt.Fprintf(w, "vmstorage - a component of VictoriaMetrics cluster. See docs at https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html")
w.Header().Add("Content-Type", "text/html; charset=utf-8")
fmt.Fprintf(w, `vmstorage - a component of VictoriaMetrics cluster<br/>
<a href="https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html">docs</a><br>
`)
return true
}
return requestHandler(w, r, strg)