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
Léo-Paul Géneau
gitlab-ce
Commits
980ac50b
Commit
980ac50b
authored
Jul 31, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into sh-support-bitbucket-server-import
parents
da88f61b
93c7b6c5
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
8 deletions
+18
-8
app/controllers/projects/lfs_api_controller.rb
app/controllers/projects/lfs_api_controller.rb
+6
-1
changelogs/unreleased/sh-lfs-fix-content-type.yml
changelogs/unreleased/sh-lfs-fix-content-type.yml
+5
-0
spec/javascripts/.eslintrc.yml
spec/javascripts/.eslintrc.yml
+0
-1
spec/javascripts/datetime_utility_spec.js
spec/javascripts/datetime_utility_spec.js
+0
-1
spec/javascripts/pdf/page_spec.js
spec/javascripts/pdf/page_spec.js
+1
-1
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+3
-1
spec/requests/lfs_http_spec.rb
spec/requests/lfs_http_spec.rb
+3
-3
No files found.
app/controllers/projects/lfs_api_controller.rb
View file @
980ac50b
class
Projects::LfsApiController
<
Projects
::
GitHttpClientController
include
LfsRequest
LFS_TRANSFER_CONTENT_TYPE
=
'application/octet-stream'
.
freeze
skip_before_action
:lfs_check_access!
,
only:
[
:deprecated
]
before_action
:lfs_check_batch_operation!
,
only:
[
:batch
]
...
...
@@ -86,7 +88,10 @@ class Projects::LfsApiController < Projects::GitHttpClientController
upload:
{
href:
"
#{
project
.
http_url_to_repo
}
/gitlab-lfs/objects/
#{
object
[
:oid
]
}
/
#{
object
[
:size
]
}
"
,
header:
{
Authorization
:
request
.
headers
[
'Authorization'
]
Authorization
:
request
.
headers
[
'Authorization'
],
# git-lfs v2.5.0 sets the Content-Type based on the uploaded file. This
# ensures that Workhorse can intercept the request.
'Content-Type'
:
LFS_TRANSFER_CONTENT_TYPE
}.
compact
}
}
...
...
changelogs/unreleased/sh-lfs-fix-content-type.yml
0 → 100644
View file @
980ac50b
---
title
:
Fix LFS uploads not working with git-lfs 2.5.0
merge_request
:
20923
author
:
type
:
fixed
spec/javascripts/.eslintrc.yml
View file @
980ac50b
...
...
@@ -30,7 +30,6 @@ rules:
jasmine/no-spec-dupes
:
-
warn
-
branch
no-console
:
off
prefer-arrow-callback
:
off
import/no-unresolved
:
-
error
...
...
spec/javascripts/datetime_utility_spec.js
View file @
980ac50b
...
...
@@ -162,7 +162,6 @@ describe('getTimeframeWindowFrom', () => {
const
timeframe
=
datetimeUtility
.
getTimeframeWindowFrom
(
startDate
,
5
);
expect
(
timeframe
.
length
).
toBe
(
5
);
timeframe
.
forEach
((
timeframeItem
,
index
)
=>
{
console
.
log
(
timeframeItem
);
expect
(
timeframeItem
.
getFullYear
()
===
mockTimeframe
[
index
].
getFullYear
()).
toBe
(
true
);
expect
(
timeframeItem
.
getMonth
()
===
mockTimeframe
[
index
].
getMonth
()).
toBe
(
true
);
expect
(
timeframeItem
.
getDate
()
===
mockTimeframe
[
index
].
getDate
()).
toBeTruthy
();
...
...
spec/javascripts/pdf/page_spec.js
View file @
980ac50b
...
...
@@ -30,7 +30,7 @@ describe('Page component', () => {
done
();
})
.
catch
((
error
)
=>
{
console
.
error
(
error
);
done
.
fail
(
error
);
});
});
...
...
spec/javascripts/test_bundle.js
View file @
980ac50b
/* eslint-disable jasmine/no-global-setup, jasmine/no-unsafe-spy, no-underscore-dangle */
/* eslint-disable
jasmine/no-global-setup, jasmine/no-unsafe-spy, no-underscore-dangle, no-console
*/
import
$
from
'
jquery
'
;
import
'
vendor/jasmine-jquery
'
;
...
...
spec/requests/lfs_http_spec.rb
View file @
980ac50b
...
...
@@ -732,7 +732,7 @@ describe 'Git LFS API and storage' do
expect
(
json_response
[
'objects'
].
first
[
'oid'
]).
to
eq
(
sample_oid
)
expect
(
json_response
[
'objects'
].
first
[
'size'
]).
to
eq
(
sample_size
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'href'
]).
to
eq
(
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
full_path
}
.git/gitlab-lfs/objects/
#{
sample_oid
}
/
#{
sample_size
}
"
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'header'
]).
to
eq
(
'Authorization'
=>
authorization
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'header'
]).
to
eq
(
{
'Authorization'
=>
authorization
,
'Content-Type'
=>
'application/octet-stream'
}
)
end
end
...
...
@@ -761,7 +761,7 @@ describe 'Git LFS API and storage' do
expect
(
lfs_object
.
projects
.
pluck
(
:id
)).
not_to
include
(
project
.
id
)
expect
(
lfs_object
.
projects
.
pluck
(
:id
)).
to
include
(
other_project
.
id
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'href'
]).
to
eq
(
"
#{
project
.
http_url_to_repo
}
/gitlab-lfs/objects/
#{
sample_oid
}
/
#{
sample_size
}
"
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'header'
]).
to
eq
(
'Authorization'
=>
authorization
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'header'
]).
to
eq
(
{
'Authorization'
=>
authorization
,
'Content-Type'
=>
'application/octet-stream'
}
)
end
end
...
...
@@ -796,7 +796,7 @@ describe 'Git LFS API and storage' do
expect
(
json_response
[
'objects'
].
first
[
'oid'
]).
to
eq
(
"91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897"
)
expect
(
json_response
[
'objects'
].
first
[
'size'
]).
to
eq
(
1575078
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'href'
]).
to
eq
(
"
#{
project
.
http_url_to_repo
}
/gitlab-lfs/objects/91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897/1575078"
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'header'
]).
to
eq
(
"Authorization"
=>
authorization
)
expect
(
json_response
[
'objects'
].
first
[
'actions'
][
'upload'
][
'header'
]).
to
eq
(
{
'Authorization'
=>
authorization
,
'Content-Type'
=>
'application/octet-stream'
}
)
expect
(
json_response
[
'objects'
].
last
[
'oid'
]).
to
eq
(
sample_oid
)
expect
(
json_response
[
'objects'
].
last
[
'size'
]).
to
eq
(
sample_size
)
...
...
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