diff --git a/delete.go b/delete.go index 0b7e17b..64b17ef 100644 --- a/delete.go +++ b/delete.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "net/http" "os" "path" @@ -38,7 +39,7 @@ func deleteHandler(c web.C, w http.ResponseWriter, r *http.Request) { return } - notFoundHandler(c, w, r) // 404 - file deleted + fmt.Fprintf(w, "DELETED") return } else { diff --git a/server_test.go b/server_test.go index 4d78137..19a189a 100644 --- a/server_test.go +++ b/server_test.go @@ -278,8 +278,8 @@ func TestPutAndDelete(t *testing.T) { req.Header.Set("X-Delete-Key", myjson.Delete_Key) goji.DefaultMux.ServeHTTP(w, req) - if w.Code != 404 { - t.Fatal("Status code was not 404, but " + strconv.Itoa(w.Code)) + if w.Code != 200 { + t.Fatal("Status code was not 200, but " + strconv.Itoa(w.Code)) } // Make sure it's actually gone @@ -334,8 +334,8 @@ func TestPutAndSpecificDelete(t *testing.T) { req.Header.Set("X-Delete-Key", "supersecret") goji.DefaultMux.ServeHTTP(w, req) - if w.Code != 404 { - t.Fatal("Status code was not 404, but " + strconv.Itoa(w.Code)) + if w.Code != 200 { + t.Fatal("Status code was not 200, but " + strconv.Itoa(w.Code)) } // Make sure it's actually gone