blob: 4f432430aaa532ebe8b5ca9ea9e43dc6156e747f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# frozen_string_literal: true
module Snippets::SendBlob
include SendsBlob
def send_snippet_blob(snippet, blob)
workhorse_set_content_type!
send_blob(
snippet.repository,
blob,
inline: content_disposition == 'inline',
allow_caching: snippet.public?
)
end
private
def content_disposition
@disposition ||= params[:inline] == 'false' ? 'attachment' : 'inline'
end
end
|