Merge branch 'fix_empty_file_response'

This commit is contained in:
Greg Karékinian
2015-03-14 15:48:15 +01:00
2 changed files with 34 additions and 24 deletions

View File

@@ -68,7 +68,10 @@ module RemoteStorage
when "application/json"
return object.data.to_json
else
return serializer_for(object.content_type) ? object.data : object.raw_data
data = serializer_for(object.content_type) ? object.data : object.raw_data
# Never return nil, always turn data into a string
return data.nil? ? '' : data
end
rescue ::Riak::HTTPFailedRequest
server.halt 404