Add message to deleted response
This commit is contained in:
parent
a40479a25f
commit
84072b3be3
4 changed files with 10 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
@ -17,6 +18,8 @@ func DeleteBucketHandler(s3 S3Client) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
code := http.StatusNoContent
|
||||
w.WriteHeader(code)
|
||||
fmt.Fprint(w, http.StatusText(code))
|
||||
})
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ func TestDeleteBucketHandler(t *testing.T) {
|
|||
"success": {
|
||||
s3: &S3ClientMock{},
|
||||
expectedStatusCode: http.StatusNoContent,
|
||||
expectedBodyContains: "",
|
||||
expectedBodyContains: http.StatusText(http.StatusNoContent),
|
||||
},
|
||||
"s3 error": {
|
||||
s3: &S3ClientMock{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
@ -17,6 +18,8 @@ func DeleteObjectHandler(s3 S3Client) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
code := http.StatusNoContent
|
||||
w.WriteHeader(code)
|
||||
fmt.Fprint(w, http.StatusText(code))
|
||||
})
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ func TestDeleteObjectHandler(t *testing.T) {
|
|||
"success": {
|
||||
s3: &S3ClientMock{},
|
||||
expectedStatusCode: http.StatusNoContent,
|
||||
expectedBodyContains: "",
|
||||
expectedBodyContains: http.StatusText(http.StatusNoContent),
|
||||
},
|
||||
"s3 error": {
|
||||
s3: &S3ClientMock{
|
||||
|
|
Loading…
Reference in a new issue