decode URLS when loading from file system
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <mbgl/storage/response.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
#include <mbgl/util/util.hpp>
|
||||
#include <mbgl/util/url.hpp>
|
||||
#include <mbgl/util/uv.hpp>
|
||||
|
||||
#include <uv.h>
|
||||
@@ -58,10 +59,10 @@ AssetRequest::AssetRequest(const Resource& resource_, Callback callback_, uv_loo
|
||||
std::string path;
|
||||
if (url.size() <= 8 || url[8] == '/') {
|
||||
// This is an empty or absolute path.
|
||||
path = url.substr(8);
|
||||
path = mbgl::util::percentDecode(url.substr(8));
|
||||
} else {
|
||||
// This is a relative path. Prefix with the application root.
|
||||
path = assetRoot + "/" + url.substr(8);
|
||||
path = assetRoot + "/" + mbgl::util::percentDecode(url.substr(8));
|
||||
}
|
||||
|
||||
uv_fs_open(loop, &req, path.c_str(), O_RDONLY, S_IRUSR, fileOpened);
|
||||
|
||||
Reference in New Issue
Block a user