diff options
author | Alexander Tkachev | 2016-06-10 14:28:04 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 6a93e8dd09ae2eeab616d14189a58633fd928c07 (patch) | |
tree | 80f8c7e52ad62321d8eed5864fa168803c99e272 /backends/cloud/googledrive | |
parent | c99b24c16d1111a701d915832f24ac457aef697d (diff) | |
download | scummvm-rg350-6a93e8dd09ae2eeab616d14189a58633fd928c07.tar.gz scummvm-rg350-6a93e8dd09ae2eeab616d14189a58633fd928c07.tar.bz2 scummvm-rg350-6a93e8dd09ae2eeab616d14189a58633fd928c07.zip |
CLOUD: Add ConnMan::urlEncode()
Tried to use it everywhere I should've use it.
Diffstat (limited to 'backends/cloud/googledrive')
-rw-r--r-- | backends/cloud/googledrive/googledrivestorage.cpp | 2 | ||||
-rw-r--r-- | backends/cloud/googledrive/googledriveuploadrequest.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/backends/cloud/googledrive/googledrivestorage.cpp b/backends/cloud/googledrive/googledrivestorage.cpp index 91d8c819e7..5eab071599 100644 --- a/backends/cloud/googledrive/googledrivestorage.cpp +++ b/backends/cloud/googledrive/googledrivestorage.cpp @@ -234,7 +234,7 @@ Networking::Request *GoogleDriveStorage::streamFile(Common::String path, Network Networking::Request *GoogleDriveStorage::streamFileById(Common::String id, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback) { if (callback) { - Common::String url = "https://www.googleapis.com/drive/v3/files/" + id + "?alt=media"; + Common::String url = "https://www.googleapis.com/drive/v3/files/" + ConnMan.urlEncode(id) + "?alt=media"; Common::String header = "Authorization: Bearer " + _token; curl_slist *headersList = curl_slist_append(nullptr, header.c_str()); Networking::NetworkReadStream *stream = new Networking::NetworkReadStream(url.c_str(), headersList, ""); diff --git a/backends/cloud/googledrive/googledriveuploadrequest.cpp b/backends/cloud/googledrive/googledriveuploadrequest.cpp index 8dd8ffcc9a..ce1fae2579 100644 --- a/backends/cloud/googledrive/googledriveuploadrequest.cpp +++ b/backends/cloud/googledrive/googledriveuploadrequest.cpp @@ -108,7 +108,7 @@ void GoogleDriveUploadRequest::startUpload() { } Common::String url = "https://www.googleapis.com/upload/drive/v3/files"; - if (_resolvedId != "") url += "/" + _resolvedId; + if (_resolvedId != "") url += "/" + ConnMan.urlEncode(_resolvedId); url += "?uploadType=resumable&fields=id,mimeType,modifiedTime,name,size"; Networking::JsonCallback callback = new Common::Callback<GoogleDriveUploadRequest, Networking::JsonResponse>(this, &GoogleDriveUploadRequest::startUploadCallback); Networking::ErrorCallback failureCallback = new Common::Callback<GoogleDriveUploadRequest, Networking::ErrorResponse>(this, &GoogleDriveUploadRequest::startUploadErrorCallback); |