dpl-s3 1.10.2.travis.2976.6 → 1.10.2.travis.2979.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd30bd24e01d18139b70d1a3a325f08ed69e6a21785fc2e18707ecd526005c69
4
- data.tar.gz: 89db858beb7998087f8b35702b9afbaf09d0db00a684e0d01041f2d41c50c7db
3
+ metadata.gz: 2aa36d806b305e35eece1da326f24375d4103de6f2172f56ce98974bd4477e8e
4
+ data.tar.gz: c86dd1c62adf149e8cdc17b2f411e4b8c25cfce0fe231f86c516839765d3d479
5
5
  SHA512:
6
- metadata.gz: 20c4586ed389dd1c6dc796da23a262b10082f8c0719bc9e5a68e5a449cc271f44e04856af9f4f4c3d38cc97f0bf48cc971c191acca6e58f9069ce56856c685a2
7
- data.tar.gz: 1804904d64d6c14967b57170cb358d5278531a42380675c3267d2c639a4fe108e07ccb4c17a9341bbfd55a4e3358f0fca8ea85864e6b2e22e8b003230fe6f5d5
6
+ metadata.gz: a40869944d2f57f371dd469d90e5044324fb46dac0cbcde8d3c385cd12d0c0c65e5cf7ebb2bf4589311bd7b39d8d15921b8a17db51e631b91e115aea4bece8c8
7
+ data.tar.gz: 081b10aa0892dcfbcbb5acc177ae6c783c0b36f19aafa9c9e4e55a44cc39585c507cdc991551426daaef07b3b39930dc1cad5b414845b47dcf3f889532d751ea
@@ -1,6 +1,7 @@
1
1
  require 'json'
2
2
  require 'aws-sdk'
3
3
  require 'mime-types'
4
+ require 'uri'
4
5
 
5
6
  Aws.eager_autoload!
6
7
 
@@ -44,7 +45,14 @@ module DPL
44
45
  credentials: ::Aws::Credentials.new(access_key_id, secret_access_key)
45
46
  }
46
47
 
47
- defaults[:endpoint] = options[:endpoint] if options[:endpoint]
48
+ if options[:endpoint]
49
+ uri = URI.parse(options[:endpoint])
50
+ unless uri.scheme
51
+ log "S3 endpoint does not specify scheme; defaulting to HTTPS"
52
+ uri = URI("https://#{options[:endpoint]}")
53
+ end
54
+ defaults[:endpoint] = uri.to_s
55
+ end
48
56
 
49
57
  defaults
50
58
  end
@@ -23,6 +23,24 @@ describe DPL::Provider::S3 do
23
23
  expect(options[:region]).to eq(region)
24
24
  end
25
25
  end
26
+
27
+ context 'with endpoint no https' do
28
+ example do
29
+ endpoint = 'myendpoint.com'
30
+ provider.options.update(:endpoint => endpoint)
31
+ options = provider.s3_options
32
+ expect(options[:endpoint]).to eq("https://#{endpoint}")
33
+ end
34
+ end
35
+
36
+ context 'with endpoint with https' do
37
+ example do
38
+ endpoint = 'https://myendpoint.com'
39
+ provider.options.update(:endpoint => endpoint)
40
+ options = provider.s3_options
41
+ expect(options[:endpoint]).to eq(endpoint)
42
+ end
43
+ end
26
44
  end
27
45
  end
28
46
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2.travis.2976.6
4
+ version: 1.10.2.travis.2979.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-21 00:00:00.000000000 Z
11
+ date: 2018-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dpl
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.2.travis.2976.6
19
+ version: 1.10.2.travis.2979.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.10.2.travis.2976.6
26
+ version: 1.10.2.travis.2979.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: aws-sdk
29
29
  requirement: !ruby/object:Gem::Requirement