From ef7e54055e17d5de86c95b83564a86a42749d040 Mon Sep 17 00:00:00 2001 From: Lena Fuhrimann <6780471+cloudlena@users.noreply.github.com> Date: Mon, 10 Apr 2017 14:19:27 +0200 Subject: [PATCH] Remove unnecessary status texts --- delete-bucket.go | 4 +--- delete-bucket_test.go | 2 +- delete-object.go | 4 +--- delete-object_test.go | 2 +- glide.lock | 4 ++-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/delete-bucket.go b/delete-bucket.go index 614113d..49fe00f 100644 --- a/delete-bucket.go +++ b/delete-bucket.go @@ -17,8 +17,6 @@ func DeleteBucketHandler(s3 S3Client) http.Handler { return } - code := http.StatusNoContent - w.WriteHeader(code) - w.Write([]byte(http.StatusText(code))) + w.WriteHeader(http.StatusNoContent) }) } diff --git a/delete-bucket_test.go b/delete-bucket_test.go index ca4fb1c..c6b091c 100644 --- a/delete-bucket_test.go +++ b/delete-bucket_test.go @@ -20,7 +20,7 @@ func TestDeleteBucketHandler(t *testing.T) { "success": { s3: &S3ClientMock{}, expectedStatusCode: http.StatusNoContent, - expectedBodyContains: http.StatusText(http.StatusNoContent), + expectedBodyContains: "", }, "s3 error": { s3: &S3ClientMock{ diff --git a/delete-object.go b/delete-object.go index 0c374ee..af5ddca 100644 --- a/delete-object.go +++ b/delete-object.go @@ -17,8 +17,6 @@ func DeleteObjectHandler(s3 S3Client) http.Handler { return } - code := http.StatusNoContent - w.WriteHeader(code) - w.Write([]byte(http.StatusText(code))) + w.WriteHeader(http.StatusNoContent) }) } diff --git a/delete-object_test.go b/delete-object_test.go index 2487494..24cd7b4 100644 --- a/delete-object_test.go +++ b/delete-object_test.go @@ -20,7 +20,7 @@ func TestDeleteObjectHandler(t *testing.T) { "success": { s3: &S3ClientMock{}, expectedStatusCode: http.StatusNoContent, - expectedBodyContains: http.StatusText(http.StatusNoContent), + expectedBodyContains: "", }, "s3 error": { s3: &S3ClientMock{ diff --git a/glide.lock b/glide.lock index d13d1fb..bc122fe 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ hash: 9b88c8ce183463a407bdb87f79b6b857d8343a7bb5ce4723223c539c654d6d6d -updated: 2017-04-07T20:28:20.316814149+02:00 +updated: 2017-04-10T14:15:00.7611986+02:00 imports: - name: github.com/gorilla/context - version: 08b5f424b9271eedf6f9f0ce86cb9396ed337a42 + version: 1ea25387ff6f684839d82767c1733ff4d4d15d0a - name: github.com/gorilla/mux version: 392c28fe23e1c45ddba891b0320b3b5df220beea - name: github.com/mastertinner/adapters