Skip to content

Commit

Permalink
get non capitalized content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
kzaitsev committed Jan 23, 2014
1 parent 3c7eb60 commit 27ecbc2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion lib/fog/openstack/models/storage/directories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def get(key, options = {})
directory.files.merge_attributes(options)
directory.files.instance_variable_set(:@loaded, true)

data.body = Fog::JSON.decode(data.body) unless data.body.is_a? Array
data.body.each do |file|
directory.files << directory.files.new(file)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/openstack/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def request(params, parse_json = true)
error
end
end
if !response.body.empty? && parse_json && response.headers['Content-Type'] =~ %r{application/json}
if !response.body.empty? && parse_json && response.get_header('Content-Type') =~ %r{application/json}
response.body = Fog::JSON.decode(response.body)
end
response
Expand Down

0 comments on commit 27ecbc2

Please sign in to comment.