chef/artifactory-client

Downloading of JSON artifact writes Ruby Hash to file

Opened this issue · 1 comments

To replicate;

  • Ensure there is a JSON file in your Artifactory
  • Create Artifactory::Client instance
  • Get Artifactory::Resource::Artifact by searching for JSON artifact
  • Call 'download' method to save to File System

The saved file will contain the string representation of a Ruby Hash rather than the document held in Artifactory.

This can be explained by the following code in Artifactory:Client;

def success(response)
  if (response.content_type || '').include?('json')
    JSON.parse(response.body)
  else
    response.body
  end
end

I will try and submit a fix soon