[libgovirt] Strip https:// from domain when setting cookie
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgovirt] Strip https:// from domain when setting cookie
- Date: Thu, 26 Jun 2014 23:21:34 +0000 (UTC)
commit 7b95c9928fd87f199d2620dfe0321dce055c8e4a
Author: Christophe Fergeau <cfergeau redhat com>
Date: Fri Apr 25 15:26:54 2014 +0200
Strip https:// from domain when setting cookie
libsoup cookie code expects a domain without a scheme.
govirt/ovirt-proxy.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index ea1bf11..123c986 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -699,13 +699,19 @@ static void ovirt_proxy_set_session_id(OvirtProxy *proxy, const char *session_id
{
SoupCookie *cookie;
char *url;
+ char *domain;
g_object_get(G_OBJECT(proxy), "url-format", &url, NULL);
g_return_if_fail(url != NULL);
+ if (g_str_has_prefix(url, "https://")) {
+ domain = url + strlen("https://");
+ } else {
+ domain = url;
+ }
g_free(proxy->priv->jsessionid);
proxy->priv->jsessionid = g_strdup(session_id);
- cookie = soup_cookie_new("JSESSIONID", session_id, url, "/api", -1);
+ cookie = soup_cookie_new("JSESSIONID", session_id, domain, "/api", -1);
g_free(url);
soup_cookie_jar_add_cookie(proxy->priv->cookie_jar, cookie);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]