excon 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of excon might be problematic. Click here for more details.
- data/Rakefile +1 -1
- data/excon.gemspec +2 -2
- data/lib/excon.rb +1 -1
- data/lib/excon/connection.rb +18 -3
- metadata +15 -4
data/Rakefile
CHANGED
@@ -92,7 +92,7 @@ task :release => :build do
|
|
92
92
|
puts "You must be on the master branch to release!"
|
93
93
|
exit!
|
94
94
|
end
|
95
|
-
sh "
|
95
|
+
sh "gem install pkg/#{name}-#{version}.gem"
|
96
96
|
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
97
97
|
sh "git tag v#{version}"
|
98
98
|
sh "git push origin master"
|
data/excon.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'excon'
|
16
|
-
s.version = '0.3.
|
17
|
-
s.date = '2010-12-
|
16
|
+
s.version = '0.3.3'
|
17
|
+
s.date = '2010-12-10'
|
18
18
|
s.rubyforge_project = 'excon'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
data/lib/excon.rb
CHANGED
data/lib/excon/connection.rb
CHANGED
@@ -45,6 +45,9 @@ module Excon
|
|
45
45
|
# connection has defaults, merge in new params to override
|
46
46
|
params = @connection.merge(params)
|
47
47
|
params[:headers] = @connection[:headers].merge(params[:headers] || {})
|
48
|
+
if params[:host]
|
49
|
+
params[:headers]['Host'] = params[:host]
|
50
|
+
end
|
48
51
|
|
49
52
|
# if path is empty or doesn't start with '/', insert one
|
50
53
|
unless params[:path][0..0] == '/'
|
@@ -152,11 +155,23 @@ module Excon
|
|
152
155
|
new_socket = TCPSocket.open(@connection[:host], @connection[:port])
|
153
156
|
|
154
157
|
if @connection[:scheme] == 'https'
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
+
# create ssl context
|
159
|
+
ssl_context = OpenSSL::SSL::SSLContext.new
|
160
|
+
# turn verification on
|
161
|
+
ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
162
|
+
|
163
|
+
# use default cert store
|
164
|
+
store = OpenSSL::X509::Store.new
|
165
|
+
store.set_default_paths
|
166
|
+
ssl_context.cert_store = store
|
167
|
+
|
168
|
+
# open ssl socket
|
169
|
+
new_socket = OpenSSL::SSL::SSLSocket.new(new_socket, ssl_context)
|
158
170
|
new_socket.sync_close = true
|
159
171
|
new_socket.connect
|
172
|
+
|
173
|
+
# verify connection
|
174
|
+
new_socket.post_connection_check(@connection[:host])
|
160
175
|
end
|
161
176
|
|
162
177
|
new_socket
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
9
|
+
- 3
|
10
|
+
version: 0.3.3
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- geemus (Wesley Beary)
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-10 00:00:00 -08:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: open4
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
version: "0"
|
@@ -33,9 +36,11 @@ dependencies:
|
|
33
36
|
name: shindo
|
34
37
|
prerelease: false
|
35
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
36
40
|
requirements:
|
37
41
|
- - "="
|
38
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 15
|
39
44
|
segments:
|
40
45
|
- 0
|
41
46
|
- 1
|
@@ -47,9 +52,11 @@ dependencies:
|
|
47
52
|
name: sinatra
|
48
53
|
prerelease: false
|
49
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
50
56
|
requirements:
|
51
57
|
- - ">="
|
52
58
|
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
53
60
|
segments:
|
54
61
|
- 0
|
55
62
|
version: "0"
|
@@ -91,23 +98,27 @@ rdoc_options:
|
|
91
98
|
require_paths:
|
92
99
|
- lib
|
93
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
94
102
|
requirements:
|
95
103
|
- - ">="
|
96
104
|
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
97
106
|
segments:
|
98
107
|
- 0
|
99
108
|
version: "0"
|
100
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
101
111
|
requirements:
|
102
112
|
- - ">="
|
103
113
|
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
104
115
|
segments:
|
105
116
|
- 0
|
106
117
|
version: "0"
|
107
118
|
requirements: []
|
108
119
|
|
109
120
|
rubyforge_project: excon
|
110
|
-
rubygems_version: 1.3.
|
121
|
+
rubygems_version: 1.3.7
|
111
122
|
signing_key:
|
112
123
|
specification_version: 2
|
113
124
|
summary: speed, persistence, http(s)
|