MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / handleUpdateCheck

Function handleUpdateCheck

cmd/dash.go:2918–2932  ·  view source on GitHub ↗

handleUpdateCheck handles GET requests to check for updates

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

2916
2917// handleUpdateCheck handles GET requests to check for updates
2918func handleUpdateCheck(w http.ResponseWriter, r *http.Request) {
2919 if r.Method != "GET" {
2920 http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
2921 return
2922 }
2923
2924 status, err := checkForUpdate()
2925 if err != nil {
2926 http.Error(w, err.Error(), http.StatusInternalServerError)
2927 return
2928 }
2929
2930 w.Header().Set("Content-Type", "application/json")
2931 json.NewEncoder(w).Encode(status)
2932}
2933
2934// handleUpdatePerform handles POST requests to perform an update
2935func handleUpdatePerform(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 2

checkForUpdateFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected