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
75a86ef8
Commit
75a86ef8
authored
Sep 05, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a 500 error in the SSH host keys lookup action
parent
f60f6872
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
changelogs/unreleased-ee/3312-fix-500-in-ssh-host-keys-action.yml
...gs/unreleased-ee/3312-fix-500-in-ssh-host-keys-action.yml
+5
-0
ee/app/models/ssh_host_key.rb
ee/app/models/ssh_host_key.rb
+2
-0
spec/controllers/projects/mirrors_controller_spec.rb
spec/controllers/projects/mirrors_controller_spec.rb
+9
-5
No files found.
changelogs/unreleased-ee/3312-fix-500-in-ssh-host-keys-action.yml
0 → 100644
View file @
75a86ef8
---
title
:
Fix a 500 error in the SSH host keys lookup action
merge_request
:
2827
author
:
type
:
fixed
ee/app/models/ssh_host_key.rb
View file @
75a86ef8
...
...
@@ -125,5 +125,7 @@ class SshHostKey
raise
ArgumentError
.
new
(
"Invalid URL"
)
unless
full_url
&
.
scheme
==
'ssh'
Addressable
::
URI
.
parse
(
"ssh://
#{
full_url
.
host
}
:
#{
full_url
.
inferred_port
}
"
)
rescue
Addressable
::
URI
::
InvalidURIError
raise
ArgumentError
.
new
(
"Invalid URL"
)
end
end
spec/controllers/projects/mirrors_controller_spec.rb
View file @
75a86ef8
...
...
@@ -223,14 +223,18 @@ describe Projects::MirrorsController do
sign_in
(
project
.
owner
)
end
context
'invalid URL'
do
context
'invalid URLs'
do
where
(
url:
%w[INVALID git@example.com:foo/bar.git ssh://git@example.com:foo/bar.git]
)
with_them
do
it
'returns an error with a 400 response'
do
do_get
(
project
,
'INVALID URL'
)
do_get
(
project
,
url
)
expect
(
response
).
to
have_http_status
(
400
)
expect
(
json_response
).
to
eq
(
'message'
=>
'Invalid URL'
)
end
end
end
context
'no data in cache'
do
it
'requests the cache to be filled and returns a 204 response'
do
...
...
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