mattermost / mattermost-plugin-msteams

Other
12 stars 10 forks source link

MM-58702: don't assume JSON endpoint #699

Closed lieut-data closed 3 weeks ago

lieut-data commented 3 weeks ago

Summary

Check the response header from the server before trying to interpret the response as JSON. Not all endpoints reply with JSON. And now those that should now do so explicitly.

Ticket Link

Fixes: https://mattermost.atlassian.net/browse/MM-58702

hmhealey commented 3 weeks ago

It's interesting to compare this to how the main server and app work. We tend to send {"status": "ok"} as a response to anything that isn't responding with data, and it never occurred to me that that was because Client4 and its predecessors always expected to receive JSON data