From cb3d9eab498210c35870d1548cdcda9372e34404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 23 Apr 2020 19:49:20 -0700 Subject: [ios, macos] Fixed receiving local file URL response --- CHANGELOG.md | 4 ++++ platform/darwin/src/http_file_source.mm | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f12eb1e287..823a47415f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ By default, the source is not volatile. +### Bug fixes + +- [ios, macos] Fixed error receiving local file URL response ([#16428](https://github.com/mapbox/mapbox-gl-native/pull/16428)) + ## maps-v1.6.0-rc.1 ### ✨ New features diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm index 1b5a67ea5d..c69abccff9 100644 --- a/platform/darwin/src/http_file_source.mm +++ b/platform/darwin/src/http_file_source.mm @@ -371,6 +371,8 @@ std::unique_ptr HTTPFileSource::request(const Resource& resource, std::make_unique(Error::Reason::Other, std::string{ "HTTP status code " } + std::to_string(responseCode)); } + } else if ([url isFileURL]) { + response.data = std::make_shared((const char *)[data bytes], [data length]); } else { // This should never happen. response.error = std::make_unique(Error::Reason::Other, -- cgit v1.2.1