Skip to content
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

Don’t even try to deserialize non-JSON response data #40

Merged
merged 1 commit into from
Oct 28, 2016
Merged

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Sep 16, 2016

For consistency with mapbox/mapbox-directions-swift#72 and mapbox/MapboxGeocoder.swift#71, don’t attempt to deserialize non-JSON response data. In the case of this library, the error would’ve been caught by the expected fallback of initializing an image out of the data. But it’s quite bizarre for the “good” code path to be inside an error handler. So now this library is additionally capable of tripping an assertion if the response claims to be JSON but isn’t well-formed for some reason.

/cc @willwhite

@1ec5 1ec5 self-assigned this Sep 16, 2016
@1ec5 1ec5 merged commit 9294ff9 into master Oct 28, 2016
@1ec5 1ec5 deleted the 1ec5-mime-826 branch October 28, 2016 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant