|
|
51ca4a |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
51ca4a |
From: Christophe Fergeau <cfergeau@redhat.com>
|
|
|
51ca4a |
Date: Mon, 8 Feb 2016 14:51:22 +0100
|
|
|
51ca4a |
Subject: [PATCH] proxy: Only set 'Prefer: persistent-auth' with jsession-id
|
|
|
51ca4a |
|
|
|
51ca4a |
When using an oauth SSO token, this header should not be set.
|
|
|
51ca4a |
---
|
|
|
51ca4a |
govirt/ovirt-proxy.c | 3 +++
|
|
|
51ca4a |
govirt/ovirt-rest-call.c | 2 --
|
|
|
51ca4a |
2 files changed, 3 insertions(+), 2 deletions(-)
|
|
|
51ca4a |
|
|
|
51ca4a |
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
|
|
|
51ca4a |
index f289719..f0ff85e 100644
|
|
|
51ca4a |
--- a/govirt/ovirt-proxy.c
|
|
|
51ca4a |
+++ b/govirt/ovirt-proxy.c
|
|
|
51ca4a |
@@ -732,6 +732,9 @@ static void ovirt_proxy_set_session_id(OvirtProxy *proxy, const char *session_id
|
|
|
51ca4a |
cookie = soup_cookie_new("JSESSIONID", session_id, domain, "/ovirt-engine/api", -1);
|
|
|
51ca4a |
soup_cookie_jar_add_cookie(proxy->priv->cookie_jar, cookie);
|
|
|
51ca4a |
proxy->priv->jsessionid_cookie = cookie;
|
|
|
51ca4a |
+ ovirt_proxy_add_header(proxy, "Prefer", "persistent-auth");
|
|
|
51ca4a |
+ } else {
|
|
|
51ca4a |
+ ovirt_proxy_add_header(proxy, "Prefer", NULL);
|
|
|
51ca4a |
}
|
|
|
51ca4a |
g_free(url);
|
|
|
51ca4a |
}
|
|
|
51ca4a |
diff --git a/govirt/ovirt-rest-call.c b/govirt/ovirt-rest-call.c
|
|
|
51ca4a |
index 9e1d9c8..cab3240 100644
|
|
|
51ca4a |
--- a/govirt/ovirt-rest-call.c
|
|
|
51ca4a |
+++ b/govirt/ovirt-rest-call.c
|
|
|
51ca4a |
@@ -127,8 +127,6 @@ static void ovirt_rest_call_constructed(GObject *object)
|
|
|
51ca4a |
} else {
|
|
|
51ca4a |
rest_proxy_call_add_header(REST_PROXY_CALL(object), "Filter", "true");
|
|
|
51ca4a |
}
|
|
|
51ca4a |
- rest_proxy_call_add_header(REST_PROXY_CALL(object),
|
|
|
51ca4a |
- "Prefer", "persistent-auth");
|
|
|
51ca4a |
ovirt_proxy_append_additional_headers(proxy, REST_PROXY_CALL(object));
|
|
|
51ca4a |
|
|
|
51ca4a |
g_object_unref(proxy);
|