Skip to content
Snippets Groups Projects
Commit b7cbf0c1 authored by Stan Hu's avatar Stan Hu Committed by GitLab Release Tools Bot
Browse files

Resolve "Imports fail in 14.5.2 fail with HTTParty::UnsupportedURIScheme error"

parent 124df2ec
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -23,6 +23,8 @@ module Import
 
return ServiceResponse.error(message: "#{@params[:url]} is not a valid URL") unless uri
 
return ServiceResponse.success if uri.scheme == 'git'
uri.fragment = nil
url = Gitlab::Utils.append_path(uri.to_s, "/info/refs?service=#{GIT_SERVICE_NAME}")
 
Loading
Loading
Loading
Loading
@@ -24,6 +24,17 @@ RSpec.describe Import::ValidateRemoteGitEndpointService do
expect(Gitlab::HTTP).to have_received(:get).with(endpoint_url, basic_auth: nil, stream_body: true, follow_redirects: false)
end
 
context 'when uri is using git:// protocol' do
subject { described_class.new(url: 'git://demo.host/repo')}
it 'returns success' do
result = subject.execute
expect(result).to be_a(ServiceResponse)
expect(result.success?).to be(true)
end
end
context 'when receiving HTTP response' do
subject { described_class.new(url: base_url) }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment