Force utf8-decoding of Unsplash reponse (#586 & #590) (#1075)

pull/1076/head
Fitz 3 years ago committed by GitHub
parent 0e3d256905
commit 322f0628e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -73,7 +73,10 @@ class Unsplash {
}
return SearchPhotosResponse.fromJson(
response.body,
// Per Response#body, if the Content-Type header is unknown, bodyBytes
// is interpreted as latin1. Unsplash returns utf8, but with no encoding
// specified in the Content-Type, so we must do it ourselves.
utf8.decode(response.bodyBytes),
);
}

@ -73,7 +73,10 @@ class Unsplash {
}
return SearchPhotosResponse.fromJson(
response.body,
// Per Response#body, if the Content-Type header is unknown, bodyBytes
// is interpreted as latin1. Unsplash returns utf8, but with no encoding
// specified in the Content-Type, so we must do it ourselves.
utf8.decode(response.bodyBytes),
);
}

Loading…
Cancel
Save