Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2019-01-10 15:30:19 +0300
committerNick Thomas <nick@gitlab.com>2019-01-10 15:30:19 +0300
commit40887a94bda88b184491a3182f08eb86cf1aeb4d (patch)
treebbc4a525aa6b8e0f95ca94948f3f5da0f5f0aeac /lib
parent0bbdbd55607a65361570fb3072664ec8a7b6cb23 (diff)
Fix files/blob api endpoint content disposition
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index aae54fb34bc..74927b4db81 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -496,7 +496,11 @@ module API
def send_git_blob(repository, blob)
env['api.format'] = :txt
content_type 'text/plain'
- header['Content-Disposition'] = content_disposition('attachment', blob.name)
+ header['Content-Disposition'] = content_disposition('inline', 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))
end