summaryrefslogtreecommitdiff
path: root/lib/gitlab/github_import/representation
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-12-14 17:51:37 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2019-01-31 16:51:54 +0100
commitb3c13bbb3c62c90dbb9a606b27699df8d681cec3 (patch)
tree335a4dc3624deb2cfed9a16e9caa49899395ed56 /lib/gitlab/github_import/representation
parent577812948dd25129e363862cfcb6d9d21d168cc2 (diff)
downloadgitlab-ce-b3c13bbb3c62c90dbb9a606b27699df8d681cec3.tar.gz
Added validations to prevent LFS object forgery
Diffstat (limited to 'lib/gitlab/github_import/representation')
-rw-r--r--lib/gitlab/github_import/representation/lfs_object.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/github_import/representation/lfs_object.rb b/lib/gitlab/github_import/representation/lfs_object.rb
index debe0fa0baf..a4606173f49 100644
--- a/lib/gitlab/github_import/representation/lfs_object.rb
+++ b/lib/gitlab/github_import/representation/lfs_object.rb
@@ -9,11 +9,11 @@ module Gitlab
attr_reader :attributes
- expose_attribute :oid, :download_link
+ expose_attribute :oid, :link, :size
# Builds a lfs_object
def self.from_api_response(lfs_object)
- new({ oid: lfs_object[0], download_link: lfs_object[1] })
+ new({ oid: lfs_object.oid, link: lfs_object.link, size: lfs_object.size })
end
# Builds a new lfs_object using a Hash that was built from a JSON payload.