diff --git a/Rakefile b/Rakefile index bee05310b..c7c938455 100644 --- a/Rakefile +++ b/Rakefile @@ -7,7 +7,7 @@ require "#{current_directory}/lib/fog" begin require 'jeweler' Jeweler::Tasks.new do |gem| - gem.add_dependency('excon', '>=0.0.17') + gem.add_dependency('excon', '>=0.0.18') gem.add_dependency('mime-types') gem.add_dependency('nokogiri') gem.add_dependency('ruby-hmac') diff --git a/lib/fog/rackspace/files.rb b/lib/fog/rackspace/files.rb index 5d448041e..a7d2ff764 100644 --- a/lib/fog/rackspace/files.rb +++ b/lib/fog/rackspace/files.rb @@ -21,13 +21,11 @@ module Fog @cdn_path = cdn_uri.path @cdn_port = cdn_uri.port @cdn_scheme = cdn_uri.scheme - @cdn_connection = Fog::Connection.new("#{@cdn_scheme}://#{@cdn_host}:#{@cdn_port}") storage_uri = URI.parse(credentials['X-Storage-Url']) @storage_host = storage_uri.host @storage_path = storage_uri.path @storage_port = storage_uri.port @storage_scheme = storage_uri.scheme - @storage_connection = Fog::Connection.new("#{@storage_scheme}://#{@storage_host}:#{@storage_port}") end def parse_data(data) @@ -52,10 +50,12 @@ module Fog end def cdn_request(params) + @cdn_connection = Fog::Connection.new("#{@cdn_scheme}://#{@cdn_host}:#{@cdn_port}") response = @cdn_connection.request({ :body => params[:body], :expects => params[:expects], :headers => { + 'Content-Type' => 'application/json', 'X-Auth-Token' => @auth_token }.merge!(params[:headers] || {}), :host => @cdn_host, @@ -70,10 +70,12 @@ module Fog end def storage_request(params) + @storage_connection = Fog::Connection.new("#{@storage_scheme}://#{@storage_host}:#{@storage_port}") response = @storage_connection.request({ :body => params[:body], :expects => params[:expects], :headers => { + 'Content-Type' => 'application/json', 'X-Auth-Token' => @auth_token }.merge!(params[:headers] || {}), :host => @storage_host, diff --git a/lib/fog/rackspace/servers.rb b/lib/fog/rackspace/servers.rb index cbe72b8cf..bde0a3fc8 100644 --- a/lib/fog/rackspace/servers.rb +++ b/lib/fog/rackspace/servers.rb @@ -57,14 +57,15 @@ module Fog @path = uri.path @port = uri.port @scheme = uri.scheme - @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") end def request(params) + @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}") response = @connection.request({ :body => params[:body], :expects => params[:expects], :headers => { + 'Content-Type' => 'application/json', 'X-Auth-Token' => @auth_token }.merge!(params[:headers] || {}), :host => @host,