-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: add spec compliant default Accept
header
#618
Conversation
@@ -62,65 +61,6 @@ test(`minimal raw query with response headers`, async () => { | |||
expect(headers.get(`X-Custom-Header`)).toEqual(reqHeaders![`X-Custom-Header`]) | |||
}) | |||
|
|||
test(`minimal raw query with response headers and new graphql content type`, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is no longer relevant as this mime-type is no longer spec compliant.
expect(result).toEqual({ ...body, status: 200 }) | ||
}) | ||
|
||
test(`minimal raw query with response headers and application/graphql-response+json response type`, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer need this test as this header is now sent by default. Also this wrongly set the Content-Type
header, whereas the content-type should always be application/json
.
expect(result).toEqual({ ...body, status: 200 }) | ||
}) | ||
|
||
test(`content-type with charset`, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was not doing anything, the relevant code was already commented out.
@@ -336,31 +276,6 @@ test.skip(`extra fetch options`, async () => { | |||
`) | |||
}) | |||
|
|||
test(`case-insensitive content-type header for custom fetch`, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was testing internal behavior of Headers
, so this should no longer be needed.
@@ -107,24 +107,6 @@ describe(`using class`, () => { | |||
expect(mock.requests[0]?.headers[`x-foo`]).toEqual(`new`) | |||
}) | |||
}) | |||
|
|||
describe(`allows content-type header to be overwritten`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was moved into the main suite.
704d636
to
c4bb3a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Adds the
Accept
header to all requests with a spec-compliant mime-type. This PR also does some code cleanup and removes support for the legacyapplication/graphql+json
mime type.Closes #140