summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Wagner <info@gunibert.de>2022-01-11 22:15:47 +0100
committerGünther Wagner <info@gunibert.de>2022-01-11 22:15:47 +0100
commit7766d718735270d1c0850685a3c7655a5726d60f (patch)
tree39e43b75d27a20e943d41e0fe7296d5043d0a1ee
parent0e7f638c3b2f5d987eaeca0d05b246bc03da6b50 (diff)
downloadlibrest-7766d718735270d1c0850685a3c7655a5726d60f.tar.gz
oauth: fix payload
Due to the change to soup3 we save the payload now as GBytes. The trailing '\0' is not part of that and therefore one has to create a full string afterwards.
-rw-r--r--rest/oauth-proxy-call.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rest/oauth-proxy-call.c b/rest/oauth-proxy-call.c
index e238c3c..b292cad 100644
--- a/rest/oauth-proxy-call.c
+++ b/rest/oauth-proxy-call.c
@@ -339,6 +339,7 @@ oauth_proxy_call_parse_token_response (OAuthProxyCall *call)
OAuthProxyPrivate *priv;
GHashTable *form;
OAuthProxy *proxy;
+ g_autofree gchar *formstr = NULL;
/* TODO: sanity checks, error handling, probably return gboolean */
@@ -349,7 +350,8 @@ oauth_proxy_call_parse_token_response (OAuthProxyCall *call)
g_object_unref (proxy);
g_assert (priv);
- form = soup_form_decode (rest_proxy_call_get_payload (REST_PROXY_CALL (call)));
+ formstr = g_strndup (rest_proxy_call_get_payload (REST_PROXY_CALL (call)), rest_proxy_call_get_payload_length (REST_PROXY_CALL (call)));
+ form = soup_form_decode (formstr);
g_free (priv->token);
g_free (priv->token_secret);