[ios, macos] Fixed receiving local file URL response
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user