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
38eb8b9b
Commit
38eb8b9b
authored
Aug 31, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve message for upload request to LFS batch URL on secondary node
parent
d2b1cf63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
app/controllers/projects/lfs_api_controller.rb
app/controllers/projects/lfs_api_controller.rb
+4
-1
spec/requests/lfs_http_spec.rb
spec/requests/lfs_http_spec.rb
+2
-1
No files found.
app/controllers/projects/lfs_api_controller.rb
View file @
38eb8b9b
class
Projects::LfsApiController
<
Projects
::
GitHttpClientController
include
ApplicationSettingsHelper
include
ApplicationHelper
include
GitlabRoutingHelper
include
LfsRequest
skip_before_action
:lfs_check_access!
,
only:
[
:deprecated
]
...
...
@@ -96,7 +99,7 @@ class Projects::LfsApiController < Projects::GitHttpClientController
if
upload_request?
&&
Gitlab
::
Geo
.
secondary?
render
(
json:
{
message:
'You cannot do writing operations on a secondary GitLab Geo instance.'
message:
"You cannot write to a secondary GitLab Geo instance. Please use
#{
geo_primary_default_url_to_repo
(
project
)
}
instead."
},
content_type:
"application/vnd.git-lfs+json"
,
status:
403
...
...
spec/requests/lfs_http_spec.rb
View file @
38eb8b9b
...
...
@@ -861,6 +861,7 @@ describe 'Git LFS API and storage' do
end
describe
'when handling lfs batch request on a secondary Geo node'
do
let!
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let
(
:authorization
)
{
authorize_user
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:path
)
{
"
#{
project
.
http_url_to_repo
}
/info/lfs/objects/batch"
}
...
...
@@ -889,7 +890,7 @@ describe 'Git LFS API and storage' do
post_lfs_json
path
,
body
.
merge
(
'operation'
=>
'upload'
),
headers
expect
(
response
).
to
have_http_status
(
403
)
expect
(
json_response
).
to
include
(
'message'
=>
'You cannot do writing operations on a secondary GitLab Geo instance.'
)
expect
(
json_response
).
to
include
(
'message'
=>
"You cannot write to a secondary GitLab Geo instance. Please use
#{
project
.
http_url_to_repo
}
instead."
)
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