diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-03 18:47:33 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-05 15:01:14 +0200 |
commit | 678620cce67cc283b19b75137f747f9415aaf942 (patch) | |
tree | 650b53c790087b88ce40f79c7c66cef6994c25b4 /lib/api/helpers.rb | |
parent | 9b1677b2deeec1faf0dd1d60a2b0c47e80b58433 (diff) | |
download | gitlab-ce-direct-upload-of-artifacts.tar.gz |
Add `direct_upload` setting for artifactsdirect-upload-of-artifacts
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index e59e8a45908..65370ad5e56 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -388,28 +388,6 @@ module API # file helpers - def uploaded_file(field, uploads_path) - if params[field] - bad_request!("#{field} is not a file") unless params[field][: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) - uploads_path = File.realpath(uploads_path) - file_path = File.realpath(params["#{field}.path"]) - bad_request!('Bad file path') unless file_path.start_with?(uploads_path) - - UploadedFile.new( - file_path, - params["#{field}.name"], - params["#{field}.type"] || 'application/octet-stream' - ) - end - def present_disk_file!(path, filename, content_type = 'application/octet-stream') filename ||= File.basename(path) header['Content-Disposition'] = "attachment; filename=#{filename}" |