summaryrefslogtreecommitdiff
path: root/protocols/CloudFile
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/CloudFile')
-rw-r--r--protocols/CloudFile/src/Services/google_service.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/protocols/CloudFile/src/Services/google_service.cpp b/protocols/CloudFile/src/Services/google_service.cpp
index db4cfc1cbd..c7498d936c 100644
--- a/protocols/CloudFile/src/Services/google_service.cpp
+++ b/protocols/CloudFile/src/Services/google_service.cpp
@@ -179,16 +179,11 @@ auto CGDriveService::CreateUploadSession(const std::string &parentId, const std:
HandleHttpError(response);
- if (HTTP_CODE_SUCCESS(response->resultCode)) {
- for (int i = 0; i < response->headersCount; i++) {
- if (mir_strcmpi(response->headers[i].szName, "Location"))
- continue;
- return std::string(response->headers[i].szValue);
- }
- }
+ if (HTTP_CODE_SUCCESS(response->resultCode))
+ if (auto *pszHdr = Netlib_GetHeader(response, "Location"))
+ return std::string(pszHdr);
HttpResponseToError(response);
-
return std::string();
}