Juan Hernandez has uploaded a new change for review.

Change subject: sdk: Add X-Ovirt-Expect and Expect
......................................................................

sdk: Add X-Ovirt-Expect and Expect

The HTTP Expect header is rejected by the Apache web server if its
values is anythiong other than 100-continue. To avoid problems the
engine explicitly removes it, and it accepts an alternative
X-Ovirt-Except header, with the same values and semantics. This patch
changes the SDK so that it will automatically add the alternative header
when the user adds the original one.

Change-Id: I2216c2256699d81dbb1a553177af39bb6a42fb3d
Related: https://bugzilla.redhat.com/1093784
Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com>
---
M src/ovirtsdk/infrastructure/proxy.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-sdk refs/changes/35/27935/1

diff --git a/src/ovirtsdk/infrastructure/proxy.py 
b/src/ovirtsdk/infrastructure/proxy.py
index 7133f47..ee6b1f1 100644
--- a/src/ovirtsdk/infrastructure/proxy.py
+++ b/src/ovirtsdk/infrastructure/proxy.py
@@ -131,6 +131,12 @@
         @param persistent_auth: session based auth
         '''
 
+        # The Apache web server ignores the "Expect" header, so if this header
+        # was explicitly added by the user, then we need to add the alternative
+        # "X-Ovirt-Expect" as well:
+        if "Expect" in headers:
+            headers["X-Ovirt-Expect"] = headers["Expect"]
+
         response = conn.doRequest(
                    method=method,
                    url=self.__prefix + url,


-- 
To view, visit http://gerrit.ovirt.org/27935
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2216c2256699d81dbb1a553177af39bb6a42fb3d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to