Открыть боковую панель
nt_test133
nt_project_uxpg8lvcuq8w
Коммиты
b1bd0d22
Коммит
b1bd0d22
создал
Ноя 04, 2015
по автору
Kamil Trzcinski
Просмотр файлов
Support download acceleration using X-Sendfile
владелец
bce3d33c
Изменения
2
Скрыть пробелы
Построчно
Рядом
lib/api/helpers.rb
Просмотр файла @
b1bd0d22
...
...
@@ -293,7 +293,15 @@ def present_file!(path, filename, content_type = 'application/octet-stream')
header
[
'Content-Disposition'
]
=
"attachment; filename=
#{
filename
}
"
header
[
'Content-Transfer-Encoding'
]
=
'binary'
content_type
content_type
file
FileStreamer
.
new
(
path
)
# Support download acceleration
case
headers
[
'X-Sendfile-Type'
]
when
'X-Sendfile'
header
[
'X-Sendfile'
]
=
path
body
else
file
FileStreamer
.
new
(
path
)
end
end
private
...
...
lib/ci/api/builds.rb
Просмотр файла @
b1bd0d22
...
...
@@ -95,7 +95,6 @@ class Builds < Grape::API
not_found!
end
# TODO: this is slow, because it doesn't support Rack::Sendfile
present_file!
(
build
.
artifact_file
.
path
,
build
.
artifact_file
.
filename
)
end
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать