Skip to content

Commit

Permalink
Merge pull request #4386 from Osmose/application-json
Browse files Browse the repository at this point in the history
Fix bug 1447416: Use application/json instead of text/json.
  • Loading branch information
Osmose committed Mar 20, 2018
2 parents 1b6057f + f1bbb4b commit 59e58d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion webapp-django/crashstats/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,4 +526,4 @@ def crash_verify(request):
# NOTE(willkg): This doesn't check postgres because that's being phased
# out.

return http.HttpResponse(json.dumps(data), content_type='text/json')
return http.HttpResponse(json.dumps(data), content_type='application/json')
4 changes: 2 additions & 2 deletions webapp-django/crashstats/crashstats/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,7 @@ def test_version_no_file(self, tmpdir):
client = Client()
resp = client.get(reverse('crashstats:dockerflow_version'))
assert resp.status_code == 200
assert resp['Content-Type'] == 'text/json'
assert resp['Content-Type'] == 'application/json'
assert resp.content == '{}'

def test_version_with_file(self, tmpdir):
Expand All @@ -2781,5 +2781,5 @@ def test_version_with_file(self, tmpdir):
client = Client()
resp = client.get(reverse('crashstats:dockerflow_version'))
assert resp.status_code == 200
assert resp['Content-Type'] == 'text/json'
assert resp['Content-Type'] == 'application/json'
assert resp.content == text
2 changes: 1 addition & 1 deletion webapp-django/crashstats/crashstats/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def dockerflow_version(requst):
data = fp.read()
else:
data = '{}'
return http.HttpResponse(data, content_type='text/json')
return http.HttpResponse(data, content_type='application/json')


@pass_default_context
Expand Down

0 comments on commit 59e58d7

Please sign in to comment.