Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
fix: vendored json content types being treated as plain text
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Aug 3, 2020
1 parent de44871 commit 5b70186
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ describe('contentTypeIsJson', () => {
expect(contentTypeIsJson(contentType)).toBe(true);
});

it('should return true if application/vnd.github.v3.star+json', () => {
const contentType = 'application/vnd.github.v3.star+json';
expect(contentTypeIsJson(contentType)).toBe(true);
});

it('should return false otherwise', () => {
const contentType = 'text/html';
expect(contentTypeIsJson(contentType)).toBe(false);
Expand Down
2 changes: 1 addition & 1 deletion packages/api-explorer/src/lib/content-type-is-json.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function contentTypeIsJson(contentType) {
const jsonContentTypes = ['application/json', 'application/vnd.api+json'];
const jsonContentTypes = ['application/json', '+json'];
return jsonContentTypes.some(ct => contentType.includes(ct));
}

Expand Down

0 comments on commit 5b70186

Please sign in to comment.