summaryrefslogtreecommitdiffstats
path: root/src/oauth/qoauth2authorizationcodeflow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/oauth/qoauth2authorizationcodeflow.cpp')
-rw-r--r--src/oauth/qoauth2authorizationcodeflow.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/oauth/qoauth2authorizationcodeflow.cpp b/src/oauth/qoauth2authorizationcodeflow.cpp
index 5738473..76d54a2 100644
--- a/src/oauth/qoauth2authorizationcodeflow.cpp
+++ b/src/oauth/qoauth2authorizationcodeflow.cpp
@@ -415,7 +415,12 @@ void QOAuth2AuthorizationCodeFlow::requestAccessToken(const QString &code)
#endif
QUrlQuery query;
parameters.insert(Key::grantType, QStringLiteral("authorization_code"));
- parameters.insert(Key::code, QUrl::toPercentEncoding(code));
+
+ if (code.contains(QLatin1Char('%')))
+ parameters.insert(Key::code, code);
+ else
+ parameters.insert(Key::code, QUrl::toPercentEncoding(code));
+
parameters.insert(Key::redirectUri, QUrl::toPercentEncoding(callback()));
parameters.insert(Key::clientIdentifier, QUrl::toPercentEncoding(d->clientIdentifier));
if (!d->clientIdentifierSharedKey.isEmpty())