Fix fetching LFS objects for private CI projects

This commit is contained in:
Kamil Trzcinski 2016-07-15 14:23:26 +02:00
parent 86f39fece2
commit bb9f827ddc
3 changed files with 8 additions and 2 deletions

View file

@ -18,6 +18,7 @@ v 8.10.0 (unreleased)
- Fix MR-auto-close text added to description. !4836
- Fix issue, preventing users w/o push access to sort tags !5105 (redetection)
- Add Spring EmojiOne updates.
- Fix fetching LFS objects for private CI projects
- Add syntax for multiline blockquote using `>>>` fence !3954
- Fix viewing notification settings when a project is pending deletion
- Fix pagination when sorting by columns with lots of ties (like priority)

View file

@ -63,7 +63,7 @@ module Grack
def ci_request?(login, password)
matched_login = /(?<s>^[a-zA-Z]*-ci)-token$/.match(login)
if project && matched_login.present? && git_cmd == 'git-upload-pack'
if project && matched_login.present?
underscored_service = matched_login['s'].underscore
if underscored_service == 'gitlab_ci'

View file

@ -98,6 +98,8 @@ describe Gitlab::Lfs::Router do
context 'with required headers' do
shared_examples 'responds with a file' do
let(:sendfile) { 'X-Sendfile' }
it 'responds with status 200' do
expect(response).to have_http_status(200)
end
@ -110,7 +112,6 @@ describe Gitlab::Lfs::Router do
context 'with user is authorized' do
let(:authorization) { authorize_user }
let(:sendfile) { 'X-Sendfile' }
context 'and does not have project access' do
let(:update_permissions) do
@ -135,6 +136,10 @@ describe Gitlab::Lfs::Router do
context 'when CI is authorized' do
let(:authorization) { authorize_ci_project }
let(:update_permissions) do
project.lfs_objects << lfs_object
end
it_behaves_like 'responds with a file'
end
end