aboutsummaryrefslogtreecommitdiffhomepage
path: root/http/response/json/json_test.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-11-03 12:03:06 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-11-03 12:03:06 -0700
commit1ff9950a551e1f96415cf918cd306b4eefb65c07 (patch)
tree46e343e2049e1094d3a8301dd4a0231d6bc84602 /http/response/json/json_test.go
parenta70e9d03ffdc876446d39f25b331ba4db914d10d (diff)
Remove charset=utf-8 from JSON responses
Diffstat (limited to 'http/response/json/json_test.go')
-rw-r--r--http/response/json/json_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/http/response/json/json_test.go b/http/response/json/json_test.go
index 9531615..ee5580b 100644
--- a/http/response/json/json_test.go
+++ b/http/response/json/json_test.go
@@ -39,7 +39,7 @@ func TestOKResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %q instead of %q`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)
@@ -72,7 +72,7 @@ func TestCreatedResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %s instead of %s`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)
@@ -105,7 +105,7 @@ func TestNoContentResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %s instead of %s`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)
@@ -140,7 +140,7 @@ func TestServerErrorResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %q instead of %q`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)
@@ -173,7 +173,7 @@ func TestBadRequestResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %s instead of %s`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)
@@ -206,7 +206,7 @@ func TestUnauthorizedResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %s instead of %s`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)
@@ -239,7 +239,7 @@ func TestForbiddenResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %s instead of %s`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)
@@ -272,7 +272,7 @@ func TestNotFoundResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %s instead of %s`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)
@@ -305,7 +305,7 @@ func TestBuildInvalidJSONResponse(t *testing.T) {
t.Fatalf(`Unexpected body, got %s instead of %s`, actualBody, expectedBody)
}
- expectedContentType := "application/json; charset=utf-8"
+ expectedContentType := contentTypeHeader
actualContentType := resp.Header.Get("Content-Type")
if actualContentType != expectedContentType {
t.Fatalf(`Unexpected content type, got %q instead of %q`, actualContentType, expectedContentType)