Skip to content

Conversation

@DigitallyBorn
Copy link
Contributor

This is likely a breaking bug fix, since requests will now correctly parse the response body as json and return a hash, instead of returning the body as a string.

Fixes #34

end
end

response.body = Fog::JSON.decode(response.body) if !response.body.empty? && response.get_header('Content-Type') == 'application/json'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value often comes back as application/json; charset=utf-8which fails the exact-string matching used before.

This is likely a breaking bug fix, since requests will now _correctly_ parse the response body as json and return a hash, instead of returning the body as a string.

Fixes fog#34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Requests are incorrectly returning strings instead of hashes

1 participant