lib/cfoundry/v2/base.rb in cfoundry-0.3.20 vs lib/cfoundry/v2/base.rb in cfoundry-0.3.21

- old
+ new

@@ -1,6 +1,6 @@ -require "json" +require "multi_json" require "base64" require "cfoundry/baseclient" require "cfoundry/uaaclient" @@ -82,11 +82,11 @@ post(fingerprints, "v2", "resource_match", :json => :json) end def upload_app(guid, zipfile, resources = []) payload = { - :resources => resources.to_json, + :resources => MultiJson.dump(resources), :multipart => true, :application => if zipfile.is_a? File zipfile elsif zipfile.is_a? String @@ -147,10 +147,10 @@ when 411, 500, 504 begin info = parse_json(response) raise CFoundry::APIError.new(info[:code], info[:description]) - rescue JSON::ParserError + rescue MultiJson::DecodeError raise CFoundry::BadResponse.new(response.code, response) end else raise CFoundry::BadResponse.new(response.code, response)