-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix!: examine response content-type if no contentType is set #535
Conversation
@@ -271,7 +271,7 @@ export class Gaxios { | |||
} | |||
|
|||
opts.validateStatus = opts.validateStatus || this.validateStatus; | |||
opts.responseType = opts.responseType || 'json'; | |||
opts.responseType = opts.responseType || 'unknown'; |
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.
I want to get some opinions on whether or not we would consider this a breaking change. Previously we defaulted for to JSON as the contentType
if the caller did not specify one. This is sort of a faulty assumption and we probably should have been looking at the response headers. I changed this to default to unknown but I fear that consumers may have been relying on this old JSON behavior.
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.
I think this would technically be breaking, although customers would be relying on a bug.
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.
If we do this, we should also update the README: https://github.com/googleapis/gaxios#request-options
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.
Updated the README
Compodoc > 1.1.19 has a dependency on marked 5.0.2 which requires node 18 minimum. Pinning compodoc in this PR. |
Warning: This pull request is touching the following templated files:
|
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #226 🦕