Commit f7fd36f2 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Adapt to the latest addressable behaviour

parent cffc28ec
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment