summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--http.go51
1 files changed, 13 insertions, 38 deletions
diff --git a/http.go b/http.go
index 857e117..8bb74b9 100644
--- a/http.go
+++ b/http.go
@@ -6,7 +6,6 @@ import (
"os"
"strings"
- pb "go.wit.com/lib/protobuf/virtbuf"
"go.wit.com/lib/virtigoxml"
"go.wit.com/log"
)
@@ -21,43 +20,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
var route string
route = cleanURL(r.URL.Path)
- // show only what droplets should be running but are missing
- if route == "/missing" {
- var count int
- var missing int
- for _, d := range me.cluster.Droplets {
- if d.StartState != pb.DropletState_ON {
- continue
- }
- count += 1
- if d.CurrentState == pb.DropletState_ON {
- continue
- }
- missing += 1
- fmt.Fprintln(w, d.Hostname, "current state:", d.CurrentState)
- }
- if missing == 0 {
- fmt.Fprintln(w, "all", count, "droplets set to run are running")
- } else {
- fmt.Fprintln(w, missing, "droplets missing")
- fmt.Fprintln(w, count, "droplets should be running")
- }
- return
- }
-
- if route == "/favicon.ico" {
- // w.Header().Set("Content-Type", "image/svg+xml")
- w.Header().Set("Content-Type", "image/png")
- writeFile(w, "ipv6.png")
- return
- }
-
- if route == "/goReference.svg" {
- w.Header().Set("Content-Type", "image/svg+xml")
- writeFile(w, "goReference.svg")
- return
- }
-
if route == "/uptime" {
ok, s := uptimeCheck()
if ok {
@@ -143,6 +105,19 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
return
}
+ if route == "/favicon.ico" {
+ // w.Header().Set("Content-Type", "image/svg+xml")
+ w.Header().Set("Content-Type", "image/png")
+ writeFile(w, "ipv6.png")
+ return
+ }
+
+ if route == "/goReference.svg" {
+ w.Header().Set("Content-Type", "image/svg+xml")
+ writeFile(w, "goReference.svg")
+ return
+ }
+
log.Warn("BAD URL =", route)
fmt.Fprintln(w, "BAD URL tmp =", route)
}