提交 f7fd36f2 编写于 作者: L Lin Jen-Shin

Adapt to the latest addressable behaviour

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册