diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-16 12:13:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-16 12:13:21 +0300 |
commit | 2c90b9b579fbfe3db191a032d2cb176761605a02 (patch) | |
tree | d9819280a1ec64ff82c31ce6081e00745a9648b4 /lib/api/helpers.rb | |
parent | ccca6cec346d169fa2521c390760af9bd885ea77 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index efeefd46502..76840091112 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -681,20 +681,27 @@ module API def send_git_blob(repository, blob) env['api.format'] = :txt content_type 'text/plain' + header['Content-Disposition'] = ActionDispatch::Http::ContentDisposition.format(disposition: 'inline', filename: blob.name) # Let Workhorse examine the content and determine the better content disposition header[Gitlab::Workhorse::DETECT_HEADER] = "true" header(*Gitlab::Workhorse.send_git_blob(repository, blob)) + + body '' end def send_git_archive(repository, **kwargs) header(*Gitlab::Workhorse.send_git_archive(repository, **kwargs)) + + body '' end def send_artifacts_entry(file, entry) header(*Gitlab::Workhorse.send_artifacts_entry(file, entry)) + + body '' end # The Grape Error Middleware only has access to `env` but not `params` nor |