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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5bb0d1ff
Commit
5bb0d1ff
authored
Oct 19, 2021
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specify maximum size for Dependency Proxy upload
parent
ee988aaa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
app/controllers/groups/dependency_proxy_for_containers_controller.rb
...lers/groups/dependency_proxy_for_containers_controller.rb
+1
-1
spec/controllers/groups/dependency_proxy_for_containers_controller_spec.rb
...groups/dependency_proxy_for_containers_controller_spec.rb
+14
-1
No files found.
app/controllers/groups/dependency_proxy_for_containers_controller.rb
View file @
5bb0d1ff
...
...
@@ -59,7 +59,7 @@ class Groups::DependencyProxyForContainersController < ::Groups::DependencyProxy
def
authorize_upload_blob
set_workhorse_internal_api_content_type
render
json:
DependencyProxy
::
FileUploader
.
workhorse_authorize
(
has_length:
false
)
render
json:
DependencyProxy
::
FileUploader
.
workhorse_authorize
(
has_length:
false
,
maximum_size:
5
.
gigabytes
)
end
def
upload_blob
...
...
spec/controllers/groups/dependency_proxy_for_containers_controller_spec.rb
View file @
5bb0d1ff
...
...
@@ -397,11 +397,24 @@ RSpec.describe Groups::DependencyProxyForContainersController do
group
.
add_guest
(
user
)
end
it
'sends Workhorse
file upload
instructions'
,
:aggregate_failures
do
it
'sends Workhorse
local file
instructions'
,
:aggregate_failures
do
authorize_upload_blob
expect
(
response
.
headers
[
'Content-Type'
]).
to
eq
(
Gitlab
::
Workhorse
::
INTERNAL_API_CONTENT_TYPE
)
expect
(
json_response
[
'TempPath'
]).
to
eq
(
DependencyProxy
::
FileUploader
.
workhorse_local_upload_path
)
expect
(
json_response
[
'RemoteObject'
]).
to
be_nil
expect
(
json_response
[
'MaximumSize'
]).
to
eq
(
5
.
gigabytes
)
end
it
'sends Workhorse remote object instructions'
,
:aggregate_failures
do
stub_dependency_proxy_object_storage
(
direct_upload:
true
)
authorize_upload_blob
expect
(
response
.
headers
[
'Content-Type'
]).
to
eq
(
Gitlab
::
Workhorse
::
INTERNAL_API_CONTENT_TYPE
)
expect
(
json_response
[
'TempPath'
]).
to
be_nil
expect
(
json_response
[
'RemoteObject'
]).
not_to
be_nil
expect
(
json_response
[
'MaximumSize'
]).
to
eq
(
5
.
gigabytes
)
end
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