status: include service status and GOARCH in HTTP headers
This will come in handy in https://github.com/gokrazy/breakglass
This commit is contained in:
parent
727ba0f371
commit
7e02056689
@ -9,6 +9,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -175,6 +176,12 @@ func initStatus(services []*service) {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
status := "started"
|
||||
if svc.Stopped() {
|
||||
status = "stopped"
|
||||
}
|
||||
w.Header().Set("X-Gokrazy-Status", status)
|
||||
w.Header().Set("X-Gokrazy-GOARCH", runtime.GOARCH)
|
||||
io.Copy(w, &buf)
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user