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 ...@@ -19,15 +19,10 @@ module Gitlab
end end
def initialize(url, credentials: nil) def initialize(url, credentials: nil)
<<<<<<< HEAD
=======
@url = Addressable::URI.parse(url.to_s.strip)
%i[user password].each do |symbol| %i[user password].each do |symbol|
credentials[symbol] = credentials[symbol].presence if credentials&.key?(symbol) credentials[symbol] = credentials[symbol].presence if credentials&.key?(symbol)
end end
>>>>>>> upstream/master
@credentials = credentials @credentials = credentials
@url = parse_url(url) @url = parse_url(url)
end end
...@@ -38,13 +33,8 @@ module Gitlab ...@@ -38,13 +33,8 @@ module Gitlab
def masked_url def masked_url
url = @url.dup url = @url.dup
<<<<<<< HEAD
url.password = "*****" if url.password
url.user = "*****" if url.user
=======
url.password = "*****" if url.password.present? url.password = "*****" if url.password.present?
url.user = "*****" if url.user.present? url.user = "*****" if url.user.present?
>>>>>>> upstream/master
url.to_s url.to_s
end end
......
...@@ -74,17 +74,8 @@ describe Gitlab::UrlSanitizer do ...@@ -74,17 +74,8 @@ describe Gitlab::UrlSanitizer do
with_them do with_them do
subject { described_class.new("http://#{userinfo}example.com").sanitized_url } 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') } it { is_expected.to eq('http://example.com') }
end end
>>>>>>> upstream/master
end end
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