summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-09-29 20:42:27 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-09-29 20:42:27 +0800
commitf7fd36f2a264d4b4cbf9b308497b419aa7bd26c1 (patch)
tree15207d68829ed6a8d3bc4c3759de9eb805f931c7
parentcffc28eca578a005a8e1256c2830c6e2bb9f2239 (diff)
downloadgitlab-ce-f7fd36f2a264d4b4cbf9b308497b419aa7bd26c1.tar.gz
Adapt to the latest addressable behaviour
-rw-r--r--lib/gitlab/url_sanitizer.rb2
-rw-r--r--spec/lib/gitlab/url_sanitizer_spec.rb4
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/gitlab/url_sanitizer.rb b/lib/gitlab/url_sanitizer.rb
index 86a36ce93d3..4e1ec1402ea 100644
--- a/lib/gitlab/url_sanitizer.rb
+++ b/lib/gitlab/url_sanitizer.rb
@@ -64,8 +64,6 @@ module Gitlab
url.password = password if password.present?
url.user = user if user.present?
url
- rescue Addressable::URI::InvalidURIError
- Addressable::URI.new
end
def generate_full_url
diff --git a/spec/lib/gitlab/url_sanitizer_spec.rb b/spec/lib/gitlab/url_sanitizer_spec.rb
index 59c28431e1e..6e31b6986a4 100644
--- a/spec/lib/gitlab/url_sanitizer_spec.rb
+++ b/spec/lib/gitlab/url_sanitizer_spec.rb
@@ -39,7 +39,8 @@ describe Gitlab::UrlSanitizer do
false | nil
false | ''
false | '123://invalid:url'
- true | 'valid@project:url.git'
+ false | 'valid@project:url.git'
+ true | 'valid:pass@project:url.git'
true | 'ssh://example.com'
true | 'ssh://:@example.com'
true | 'ssh://foo@example.com'
@@ -117,7 +118,6 @@ describe Gitlab::UrlSanitizer do
'http://example.com' | { user: nil, password: nil }
# Credentials from SCP-style URLs are not supported at present
- 'foo@example.com:path' | { user: nil, password: nil }
'foo:bar@example.com:path' | { user: nil, password: nil }
# Other invalid URLs