Skip to content
Browse files

Merge pull request #1142 from grkvlt/accept-headers-openstack

Add Accept header with application/json media type to OpenStack requests
  • Loading branch information...
2 parents 294e972 + 2d4f0fa commit 794f1159a22187a1589e2f838ae47568a0f41fd2 @dprince dprince committed Nov 13, 2012
View
1 lib/fog/openstack.rb
@@ -114,6 +114,7 @@ def self.authenticate_v2(options, connection_options = {})
"#{uri.scheme}://#{uri.host}:#{uri.port}/v2.0/tenants", false, connection_options).request({
:expects => [200, 204],
:headers => {'Content-Type' => 'application/json',
+ 'Accept' => 'application/json',
'X-Auth-Token' => body['access']['token']['id']},
:host => uri.host,
:method => 'GET'
View
1 lib/fog/openstack/compute.rb
@@ -300,6 +300,7 @@ def request(params)
response = @connection.request(params.merge({
:headers => {
'Content-Type' => 'application/json',
+ 'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,
View
1 lib/fog/openstack/identity.rb
@@ -203,6 +203,7 @@ def request(params)
response = @connection.request(params.merge({
:headers => {
'Content-Type' => 'application/json',
+ 'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,
View
1 lib/fog/openstack/requests/compute/list_tenants.rb
@@ -6,6 +6,7 @@ def list_tenants
response = @identity_connection.request({
:expects => [200, 204],
:headers => {'Content-Type' => 'application/json',
+ 'Accept' => 'application/json',
'X-Auth-Token' => @auth_token},
:method => 'GET',
:path => '/v2.0/tenants'
View
1 lib/fog/openstack/volume.rb
@@ -142,6 +142,7 @@ def request(params)
response = @connection.request(params.merge({
:headers => {
'Content-Type' => 'application/json',
+ 'Accept' => 'application/json',
'X-Auth-Token' => @auth_token
}.merge!(params[:headers] || {}),
:host => @host,

0 comments on commit 794f115

Please sign in to comment.
Something went wrong with that request. Please try again.