Commit ea7f5a05 authored by Rémy Coutable's avatar Rémy Coutable

Resolve conflict in lib/gitlab/url_sanitizer.rb

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 47c09cfd
......@@ -19,15 +19,10 @@ module Gitlab
end
def initialize(url, credentials: nil)
<<<<<<< HEAD
=======
@url = Addressable::URI.parse(url.to_s.strip)
%i[user password].each do |symbol|
credentials[symbol] = credentials[symbol].presence if credentials&.key?(symbol)
end
>>>>>>> upstream/master
@credentials = credentials
@url = parse_url(url)
end
......@@ -38,13 +33,8 @@ module Gitlab
def masked_url
url = @url.dup
<<<<<<< HEAD
url.password = "*****" if url.password
url.user = "*****" if url.user
=======
url.password = "*****" if url.password.present?
url.user = "*****" if url.user.present?
>>>>>>> upstream/master
url.to_s
end
......
......@@ -74,17 +74,8 @@ describe Gitlab::UrlSanitizer do
with_them do
subject { described_class.new("http://#{userinfo}example.com").sanitized_url }
<<<<<<< HEAD
describe '.valid?' do
it 'validates url strings' do
expect(described_class.valid?(nil)).to be(false)
expect(described_class.valid?('')).to be(false)
expect(described_class.valid?('valid@project:url.git')).to be(true)
expect(described_class.valid?('123://invalid:url')).to be(false)
=======
it { is_expected.to eq('http://example.com') }
end
>>>>>>> upstream/master
end
end
......
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