dependabot-common 0.116.2 → 0.116.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 341698a302a0bda029a2404b6622caee807187c038ef0eca920ef22cd0141301
4
- data.tar.gz: afe8641e292e52541ca1971d3790fdcf8820777c2b144f6bf131309dca10c6e1
3
+ metadata.gz: 100592e19e79ca976be5212fd173dae233cb216d37057632382120d7717edcf9
4
+ data.tar.gz: 605473cb4148339c77bd604ef8c2b1bff894a06f09811661f9ef8ae7446766f7
5
5
  SHA512:
6
- metadata.gz: dca7601497209f6e70f3157ae48f8a9dcd437034b370c754be6c765d1c89ad91a151d2980853bfd8e0547527be9c3a9c2d1568470dcecdf2cbd2b07eb9ff33c1
7
- data.tar.gz: 7e7d5313d1d148045f12e0da8eb0fb357d3551930db7d339c81f57e7a985ccfabe29ad58ea0361a77a4915694480fa9015388e6d47dc3bceaec0658166b814a8
6
+ metadata.gz: 7d5e0befccd09c82e2fbce6b6fcbc80d4c6f92fa379ec88bf6e318c8d77f6098e88c75520711d4bab28b597f1552307d5ed452ccf8622f2057dd1f19fca10988
7
+ data.tar.gz: deb8403fb9af1c6ca9c2477a78e6145738f409699b3a97b2951642f53af33d0da0f7182303bae5cb22ff017d388bab8f51b973e3c45d709489441712f805785e
@@ -156,16 +156,26 @@ module Dependabot
156
156
  cred = credentials.select { |c| c["type"] == "git_source" }.
157
157
  find { |c| bare_uri.start_with?(c["host"]) }
158
158
 
159
+ scheme = scheme_for_uri(uri)
160
+
159
161
  if bare_uri.match?(%r{[^/]+:[^/]+@})
160
162
  # URI already has authentication details
161
- "https://#{bare_uri}"
163
+ "#{scheme}://#{bare_uri}"
162
164
  elsif cred&.fetch("username", nil) && cred&.fetch("password", nil)
163
165
  # URI doesn't have authentication details, but we have credentials
164
166
  auth_string = "#{cred.fetch('username')}:#{cred.fetch('password')}"
165
- "https://#{auth_string}@#{bare_uri}"
167
+ "#{scheme}://#{auth_string}@#{bare_uri}"
168
+ else
169
+ # No credentials, so just return the http(s) URI
170
+ "#{scheme}://#{bare_uri}"
171
+ end
172
+ end
173
+
174
+ def scheme_for_uri(uri)
175
+ if uri.match?(%r{^http://})
176
+ "http"
166
177
  else
167
- # No credentials, so just return the https URI
168
- "https://#{bare_uri}"
178
+ "https"
169
179
  end
170
180
  end
171
181
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.116.2"
4
+ VERSION = "0.116.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.116.2
4
+ version: 0.116.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-10 00:00:00.000000000 Z
11
+ date: 2020-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-codecommit