diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2020-04-23 19:49:20 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2020-04-23 19:49:45 -0700 |
commit | f311e3390b133341c9a83997e4bd38b74d534346 (patch) | |
tree | 789c8690432172988e1b65a710f7993a8d21d32f | |
parent | 9f8c9c61e87868510ee2951c93044c4995478641 (diff) | |
download | qtlocation-mapboxgl-upstream/1ec5-local-response-16427.tar.gz |
[ios, macos] Fixed receiving local file URL responseupstream/1ec5-local-response-16427
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | platform/darwin/src/http_file_source.mm | 2 |
2 files changed, 6 insertions, 0 deletions
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<AsyncRequest> HTTPFileSource::request(const Resource& resource, std::make_unique<Error>(Error::Reason::Other, std::string{ "HTTP status code " } + std::to_string(responseCode)); } + } else if ([url isFileURL]) { + response.data = std::make_shared<std::string>((const char *)[data bytes], [data length]); } else { // This should never happen. response.error = std::make_unique<Error>(Error::Reason::Other, |