You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by lu...@redhat.com on 2012/12/04 09:42:33 UTC

[PATCH 5/6] CIMI tests: allow setting the Content-Type header for requests

From: David Lutterkort <lu...@redhat.com>

---
 tests/cimi/test_helper.rb |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb
index fccfcbc..e967e55 100644
--- a/tests/cimi/test_helper.rb
+++ b/tests/cimi/test_helper.rb
@@ -181,12 +181,15 @@ module CIMI::Test::Methods
     def headers(params)
       headers = api.auth_header
       if params[:accept]
-        headers["Accept"] = "application/#{params.delete(:accept)}"
+        headers["Accept"] = "application/#{params[:accept]}"
       else
         # @content_type is set by the harness below
         # if it isn't, default to XML
         headers["Accept"] = @content_type || "application/xml"
       end
+      if params[:content_type]
+        headers["Content-Type"] = "application/#{params[:content_type]}"
+      end
       headers
     end
 
-- 
1.7.7.6