Commit 8ce4d58f authored by Stan Hu's avatar Stan Hu

Merge branch...

Merge branch '349096-imports-fail-in-14-5-2-fail-with-httparty-unsupportedurischeme-error' into 'master'

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

See merge request gitlab-org/gitlab!78479
parents 082342b9 0f5eade6
...@@ -23,6 +23,8 @@ module Import ...@@ -23,6 +23,8 @@ module Import
return ServiceResponse.error(message: "#{@params[:url]} is not a valid URL") unless uri return ServiceResponse.error(message: "#{@params[:url]} is not a valid URL") unless uri
return ServiceResponse.success if uri.scheme == 'git'
uri.fragment = nil uri.fragment = nil
url = Gitlab::Utils.append_path(uri.to_s, "/info/refs?service=#{GIT_SERVICE_NAME}") url = Gitlab::Utils.append_path(uri.to_s, "/info/refs?service=#{GIT_SERVICE_NAME}")
......
...@@ -24,6 +24,17 @@ RSpec.describe Import::ValidateRemoteGitEndpointService do ...@@ -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) expect(Gitlab::HTTP).to have_received(:get).with(endpoint_url, basic_auth: nil, stream_body: true, follow_redirects: false)
end 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 context 'when receiving HTTP response' do
subject { described_class.new(url: base_url) } subject { described_class.new(url: base_url) }
......
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