Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
da359c46
Commit
da359c46
authored
Feb 06, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'api-fix-files' into 'master'
API: Fix file downloading See merge request !8953
parents
572fb0be
f5de8f15
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
changelogs/unreleased/api-fix-files.yml
changelogs/unreleased/api-fix-files.yml
+4
-0
lib/api/helpers.rb
lib/api/helpers.rb
+1
-1
spec/requests/api/builds_spec.rb
spec/requests/api/builds_spec.rb
+1
-0
spec/support/matchers/match_file.rb
spec/support/matchers/match_file.rb
+5
-0
No files found.
changelogs/unreleased/api-fix-files.yml
0 → 100644
View file @
da359c46
---
title
:
'
API:
Fix
file
downloading'
merge_request
:
Robert Schilling
author
:
8267
lib/api/helpers.rb
View file @
da359c46
...
@@ -304,7 +304,7 @@ module API
...
@@ -304,7 +304,7 @@ module API
header
[
'X-Sendfile'
]
=
path
header
[
'X-Sendfile'
]
=
path
body
body
else
else
path
file
path
end
end
end
end
...
...
spec/requests/api/builds_spec.rb
View file @
da359c46
...
@@ -188,6 +188,7 @@ describe API::Builds, api: true do
...
@@ -188,6 +188,7 @@ describe API::Builds, api: true do
it
'returns specific job artifacts'
do
it
'returns specific job artifacts'
do
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
.
headers
).
to
include
(
download_headers
)
expect
(
response
.
headers
).
to
include
(
download_headers
)
expect
(
response
.
body
).
to
match_file
(
build
.
artifacts_file
.
file
.
file
)
end
end
end
end
...
...
spec/support/matchers/match_file.rb
0 → 100644
View file @
da359c46
RSpec
::
Matchers
.
define
:match_file
do
|
expected
|
match
do
|
actual
|
expect
(
Digest
::
MD5
.
hexdigest
(
actual
)).
to
eq
(
Digest
::
MD5
.
hexdigest
(
File
.
read
(
expected
)))
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment