File TemporarilyMovedUseSameMethod.patch of Package libkgapi
From: Jonathan Marten <jjm@keelhaul.me.uk>
Subject: [PATCH] Accept HTTP status 307 as a redirect
Google appears to return this code when downloading a Drive document.
It is not being interpreted as a redirect and so the download fails with
an unknown error.
Git commit 6e799a18f89b2db0d3abc82d962cb66fa2cce211 by David Barchiesi, on behalf of Jonathan Marten.
Committed on 07/09/2020 at 10:05.
Pushed by barchiesi into branch 'release/20.08'.
References: kde#425261
FIXED-IN: 20.08.2
---
src/core/job.cpp | 1 +
src/core/types.h | 1 +
2 files changed, 2 insertions(+)
Patch adapted for libkgapi 20.04.
diff -Nur a/src/core/job.cpp b/src/core/job.cpp
--- a/src/core/job.cpp
+++ b/src/core/job.cpp
@@ -184,6 +184,7 @@
case KGAPI2::NoContent: /** << OK status (removed task using Tasks API) */
break;
+ case KGAPI2::TemporarilyMovedUseSameMethod: /** << Temporarily moved - Google provides a new URL where to send the request which must use the original method */
case KGAPI2::TemporarilyMoved: { /** << Temporarily moved - Google provides a new URL where to send the request */
qCDebug(KGAPIDebug) << "Google says: Temporarily moved to " << reply->header(QNetworkRequest::LocationHeader).toUrl();
QNetworkRequest request = currentRequest.request;
diff -Nur a/src/core/types.h b/src/core/types.h
--- a/src/core/types.h
+++ b/src/core/types.h
@@ -201,6 +201,7 @@
NoContent = 204, ///< Tasks API returns 204 when task is successfully removed.
TemporarilyMoved = 302, ///< The object is located on a different URL provided in reply.
NotModified = 304, ///< Request was successful, but no data were updated.
+ TemporarilyMovedUseSameMethod = 307, ///< The object is located at a different URL provided in the reply. The same request method must be used.
BadRequest = 400, ///< Invalid (malformed) request.
Unauthorized = 401, ///< Invalid or expired token. See KGAPI2::Account::refreshTokens().
Forbidden = 403, ///< The requested data is not accessible to this account.