diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2016-01-14 12:57:33 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2016-01-14 12:57:33 +0000 |
commit | f03da18e3a925e88b46aabb5e095b90abe0f0131 (patch) | |
tree | 9cc013a388489cd6930e654428081a86dc62056a /lib/api/helpers.rb | |
parent | f981da44ab88012db984e1457170067b345660c1 (diff) | |
parent | be764a3a20c7cecce2a047ddd46aff954c33b306 (diff) | |
download | gitlab-ce-f03da18e3a925e88b46aabb5e095b90abe0f0131.tar.gz |
Merge branch 'ci/view-build-artifacts' into 'master'
Add browser for build artifacts
Discussion in #3426, closes #3426.
See merge request !2123
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index a4df810e755..d46b5c42967 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -289,12 +289,14 @@ module API # file helpers - def uploaded_file!(field, uploads_path) + def uploaded_file(field, uploads_path) if params[field] bad_request!("#{field} is not a file") unless params[field].respond_to?(:filename) return params[field] end + return nil unless params["#{field}.path"] && params["#{field}.name"] + # sanitize file paths # this requires all paths to exist required_attributes! %W(#{field}.path) |