aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/googledrive
diff options
context:
space:
mode:
Diffstat (limited to 'backends/cloud/googledrive')
-rw-r--r--backends/cloud/googledrive/googledrivestorage.cpp2
-rw-r--r--backends/cloud/googledrive/googledriveuploadrequest.cpp2
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);