Commit 5c369b20 authored by Jonathan Marten's avatar Jonathan Marten

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.
parent b0e97b06
Pipeline #30113 passed with stage
in 7 minutes and 50 seconds
......@@ -170,6 +170,7 @@ void Job::Private::_k_replyReceived(QNetworkReply* reply)
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;
......
......@@ -189,6 +189,7 @@ enum Error {
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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment