diff --git a/http.go b/http.go index 1b9d0c9..a56a456 100644 --- a/http.go +++ b/http.go @@ -73,8 +73,17 @@ func okHandler(w http.ResponseWriter, r *http.Request) { for _, dir := range c.Dirs { log.Info("append dir", dir) fmt.Fprintln(w, "append dir", dir) - me.dirs = append(me.dirs, dir) + var found bool = false + for _, d := range me.dirs { + if d == dir { + found = true + } + } + if ! found { + me.dirs = append(me.dirs, dir) + } } + return } if tmp == "/start" {