diff options
author | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-04-02 07:48:28 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-04-02 07:48:28 +0000 |
commit | b122be5ed55e3898196fb21e47fff40eb7dd6e0c (patch) | |
tree | 709d2763de4f693086b1f0cbe8848df3a8ed5509 /lib | |
parent | 02dcecdb5f51f6988ede356d0d245d6cd7745520 (diff) | |
parent | 732f892db308863f2a2db736949c94ae9d613678 (diff) | |
download | gitlab-ce-b122be5ed55e3898196fb21e47fff40eb7dd6e0c.tar.gz |
Merge branch 'security-id-potential-denial-languages' into 'master'
Return cached languages if they've been detected before
See merge request gitlab/gitlabhq!2998
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/import_export/import_export.yml | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 91501ba4d36..22c90e4e83e 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -392,11 +392,9 @@ module API desc 'Get languages in project repository' get ':id/languages' do - if user_project.repository_languages.present? - user_project.repository_languages.map { |l| [l.name, l.share] }.to_h - else - user_project.repository.languages.map { |language| language.values_at(:label, :value) }.to_h - end + ::Projects::RepositoryLanguagesService + .new(user_project, current_user) + .execute.map { |lang| [lang.name, lang.share] }.to_h end desc 'Remove a project' diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml index a0aab9fcbaf..d5a291dfa78 100644 --- a/lib/gitlab/import_export/import_export.yml +++ b/lib/gitlab/import_export/import_export.yml @@ -117,6 +117,7 @@ excluded_attributes: - :description_html - :repository_languages - :bfg_object_map + - :detected_repository_languages - :tag_list namespaces: - :runners_token |