dangerous_open_uri 1.0.2 → 1.0.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
  SHA1:
3
- metadata.gz: 96cdce9d0358d8066a0f0e8b3611871f48b9c5c5
4
- data.tar.gz: 1a26ebb5c237195b637d6d43215ff4ff30a1a835
3
+ metadata.gz: abb4db861c1b5ab25d7f11bd1bb2f544b8e9bada
4
+ data.tar.gz: 4155750ebc90ebd926a93f3e5dff9d78b16b578a
5
5
  SHA512:
6
- metadata.gz: 73ad28a9db52241a31499b745c2f46645120e85fb82bf72058fc94f6117495441cc49ce7937f5eb177b579906d28c97c516e90456ceedbf98681a88e8b2474aa
7
- data.tar.gz: 10a0ac994c377000cbed6a35d647117861be3dc089343ab34a3b1e4a76e2b733ffd7d54cac8758b4515dd43b730e5f52a07a56a31136756eaad5eb99ab14f096
6
+ metadata.gz: 4c65d12e43e7a4a88411a945f7bf506f0ee84ead54357fed556d16345538a8e782a88d25bd2a8807e11c5de4a2fe789501887d6fb2ab8999091c99157452dabc
7
+ data.tar.gz: ad36b7cc1d7bef21b6f9987a25f868b0227dcd9172e866c8f52e5ece16857cd0dcacfcd6bb1406f7e5b6e06fa58d38cc2db86ac944130994cd5605ffdafa1245
data/README.md CHANGED
@@ -39,7 +39,7 @@ require 'dangerous_open_uri'
39
39
  open('http://user:pass@example.co.jp/secret/page').read
40
40
  #=> Enable to read `http://user:pass@example.co.jp/secret/page` sources
41
41
 
42
- open('http://example.co.jp/index.html, proxy: 'http://user:pass@proxy.example.com')
42
+ open('http://example.co.jp/index.html', proxy: 'http://user:pass@proxy.example.com')
43
43
  #=> Proxy basic authentication uses `user` and `pass`
44
44
  ```
45
45
 
@@ -1,3 +1,3 @@
1
1
  module DangerousOpenUri
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -16,11 +16,13 @@ module OpenURI
16
16
  end
17
17
  end
18
18
 
19
- if target.userinfo
20
- options[:http_basic_authentication] = [target.user, target.password]
21
- target.userinfo = ""
19
+ _target = target.dup
20
+
21
+ if _target.userinfo
22
+ options[:http_basic_authentication] = [_target.user, _target.password]
23
+ _target.userinfo = ""
22
24
  end
23
25
 
24
- original_open_http(buf, target, proxy, options)
26
+ original_open_http(buf, _target, proxy, options)
25
27
  end
26
28
  end
@@ -68,6 +68,17 @@ describe OpenURI do
68
68
  ).to eq('aaa')
69
69
  end
70
70
 
71
+ it 'given URI::Generic does not change the argument object' do
72
+ uri = URI.parse('http://user:pass@www.example.com/secret/page.html')
73
+
74
+ stub_request(:any, 'http://user:pass@www.example.com/secret/page.html')
75
+ .to_return(body: 'aaa')
76
+
77
+ open(uri)
78
+
79
+ expect(uri).to eq(URI.parse('http://user:pass@www.example.com/secret/page.html'))
80
+ end
81
+
71
82
  describe 'given proxy' do
72
83
  it 'original_open_http receives the correct proxy arguments' do
73
84
  uri = URI.parse('http://www.example.com/secret/page.html')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dangerous_open_uri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mgi166
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-19 00:00:00.000000000 Z
11
+ date: 2014-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler