summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rest/oauth-proxy-call.c6
-rw-r--r--rest/rest-proxy-call-private.h2
-rw-r--r--rest/rest-proxy-call.c11
3 files changed, 17 insertions, 2 deletions
diff --git a/rest/oauth-proxy-call.c b/rest/oauth-proxy-call.c
index 63c859f..3056753 100644
--- a/rest/oauth-proxy-call.c
+++ b/rest/oauth-proxy-call.c
@@ -119,6 +119,7 @@ sign_hmac (OAuthProxy *proxy, RestProxyCall *call, GHashTable *oauth_params)
{
OAuthProxyPrivate *priv;
RestProxyCallPrivate *callpriv;
+ const char *url_str;
char *key, *signature, *ep, *eep;
const char *content_type;
GString *text;
@@ -129,6 +130,7 @@ sign_hmac (OAuthProxy *proxy, RestProxyCall *call, GHashTable *oauth_params)
priv = PROXY_GET_PRIVATE (proxy);
callpriv = call->priv;
+ url_str = rest_proxy_call_get_url (call);
text = g_string_new (NULL);
g_string_append (text, rest_proxy_call_get_method (REST_PROXY_CALL (call)));
@@ -136,7 +138,7 @@ sign_hmac (OAuthProxy *proxy, RestProxyCall *call, GHashTable *oauth_params)
if (priv->oauth_echo) {
g_string_append_uri_escaped (text, priv->service_url, NULL, FALSE);
} else if (priv->signature_host != NULL) {
- SoupURI *url = soup_uri_new (callpriv->url);
+ SoupURI *url = soup_uri_new (url_str);
gchar *signing_url;
soup_uri_set_host (url, priv->signature_host);
@@ -147,7 +149,7 @@ sign_hmac (OAuthProxy *proxy, RestProxyCall *call, GHashTable *oauth_params)
soup_uri_free (url);
g_free (signing_url);
} else {
- g_string_append_uri_escaped (text, callpriv->url, NULL, FALSE);
+ g_string_append_uri_escaped (text, url_str, NULL, FALSE);
}
g_string_append_c (text, '&');
diff --git a/rest/rest-proxy-call-private.h b/rest/rest-proxy-call-private.h
index c915691..573794e 100644
--- a/rest/rest-proxy-call-private.h
+++ b/rest/rest-proxy-call-private.h
@@ -55,6 +55,8 @@ struct _RestProxyCallPrivate {
RestProxyCallAsyncClosure *cur_call_closure;
};
+const char *rest_proxy_call_get_url (RestProxyCall *call);
+
G_END_DECLS
#endif /* _REST_PROXY_CALL_PRIVATE */
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c
index 22de07d..3339d47 100644
--- a/rest/rest-proxy-call.c
+++ b/rest/rest-proxy-call.c
@@ -1607,3 +1607,14 @@ rest_proxy_call_serialize_params (RestProxyCall *call,
return FALSE;
}
+
+G_GNUC_INTERNAL const char *
+rest_proxy_call_get_url (RestProxyCall *call)
+{
+ /* Ensure priv::url is current before returning it. This method is used
+ * by OAuthProxyCall::_prepare which expects set_url() to have been called,
+ * but this has been changed/broken by c66b6df
+ */
+ set_url(call);
+ return call->priv->url;
+}