You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
client_options are an escape hatch I added for those that needed it. If, for whatever reason, this needs to be changed to something else (application/json; charset=utf-8 maybe?) in the future, I'd rather still leave that door open for others. But the default here is reasonable, since most folks aren't using that option, or have already changed their invocation to add the header that's needed right now.
76fc78a
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.
Won't this break if the user supplies a
client_options
hash inTeslaApi::Client.new
?76fc78a
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.
Of course it will. With this commit in place,
fails with the same 406 error as before.
76fc78a
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 you really want to use the
client_options
hash, then you want to do something like76fc78a
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.
client_options are an escape hatch I added for those that needed it. If, for whatever reason, this needs to be changed to something else (
application/json; charset=utf-8
maybe?) in the future, I'd rather still leave that door open for others. But the default here is reasonable, since most folks aren't using that option, or have already changed their invocation to add the header that's needed right now.76fc78a
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.
Up to you, of course, but I'd prefer that code that worked before Tesla tweaked their API ought to work again, after this fix.
But you are right, the code I posted does not allow the user to override the value of the
Accept
header. This does: