oauth2
oauth2 copied to clipboard
Defaults to application/json when content-type header is not present
Thanks for the amazing library! I came across a bug and wanted to report:
The OAuth2 library defaults to application/json
response type when no content-type
header is present. Since the Response
module calls serializer.decode!(body)
, this causes an exception (as expected) since the body being decoded is probably not JSON.
The default should probably be text/plain
and it should return the body as-is. On a side note, you should probably use Plug's implementation of extracting content-type, so it correctly parses even when there is extra metadata attached.
(For reference, I'm having this issue with the Zendesk API where some API responses don't have the content-type header).
I'm here to +1 this, we've had an issue with Auth0 today and we've run into the same issue. I'm happy to contribute some code if you would like help on this!
I agree with this, but I am not sure how much of a breaking change would be and the potential downsides of it, I think it will be prudent to try to have some answer for such concern or at the very least a backup plan or guidelines for peeps facing the potential issue with it.
@ueberauth/developers any thoughts on the subject?
This issue has been automatically marked as "stale:discard". If this issue still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment.
Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!