diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2016-02-08 14:51:22 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2016-04-08 17:59:46 +0200 |
commit | d3683c20e62d889e187406b3fa3fe75e00df228d (patch) | |
tree | 614808e92d4c84d66e8f18000dfe631006561a02 | |
parent | 96f588db79e6716216341a9ee2437ce878fcba93 (diff) |
proxy: Only set 'Prefer: persistent-auth' with jsession-id
When using an oauth SSO token, this header should not be set.
-rw-r--r-- | govirt/ovirt-proxy.c | 3 | ||||
-rw-r--r-- | govirt/ovirt-rest-call.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c index e361635..ef281ae 100644 --- a/govirt/ovirt-proxy.c +++ b/govirt/ovirt-proxy.c @@ -794,6 +794,9 @@ static void ovirt_proxy_set_session_id(OvirtProxy *proxy, const char *session_id cookie = soup_cookie_new("JSESSIONID", session_id, domain, "/ovirt-engine/api", -1); soup_cookie_jar_add_cookie(proxy->priv->cookie_jar, cookie); proxy->priv->jsessionid_cookie = cookie; + ovirt_proxy_add_header(proxy, "Prefer", "persistent-auth"); + } else { + ovirt_proxy_add_header(proxy, "Prefer", NULL); } g_free(url); } diff --git a/govirt/ovirt-rest-call.c b/govirt/ovirt-rest-call.c index 9e1d9c8..cab3240 100644 --- a/govirt/ovirt-rest-call.c +++ b/govirt/ovirt-rest-call.c @@ -127,8 +127,6 @@ static void ovirt_rest_call_constructed(GObject *object) } else { rest_proxy_call_add_header(REST_PROXY_CALL(object), "Filter", "true"); } - rest_proxy_call_add_header(REST_PROXY_CALL(object), - "Prefer", "persistent-auth"); ovirt_proxy_append_additional_headers(proxy, REST_PROXY_CALL(object)); g_object_unref(proxy); |