Adapt to the latest addressable behaviour

This commit is contained in:
Lin Jen-Shin 2017-09-29 20:42:27 +08:00
parent cffc28eca5
commit f7fd36f2a2
2 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -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