emmy-http-client 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/emmy-http-client.gemspec +1 -1
- data/lib/emmy_http/client/client.rb +5 -3
- data/lib/emmy_http/client/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35283fd9ab14415f3033f0f384cf8f2596a1c21c
|
4
|
+
data.tar.gz: a93d21ba7741067a021714a507c0d7e53b704bda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d93a2971c251fcc46f7b067249ad4a9e23ad8863fefc3a99c4677dbbccb1a08e2c1a233f7f23ee1718e0359538667ae0680df2586785e721fd17766ee891248d
|
7
|
+
data.tar.gz: 1c10235bcae47cc4b7135398a754caf9a677f81489e41b34902bdd01303c38ddfb08dca30c21bc414dc248d5e3b139c4619d95c925a1a24aa2c970f08306abd6
|
data/emmy-http-client.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency "event_object", "~> 0.9.1"
|
24
24
|
spec.add_dependency "fibre", "~> 0.9.7"
|
25
25
|
spec.add_dependency "emmy-machine", "~> 0.1.7"
|
26
|
-
|
26
|
+
spec.add_dependency "emmy-http", "~> 0.1.6"
|
27
27
|
|
28
28
|
spec.add_development_dependency "bundler", "~> 1.9"
|
29
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -56,12 +56,13 @@ module EmmyHttp
|
|
56
56
|
|
57
57
|
parser.on :completed do
|
58
58
|
client.response.finish
|
59
|
+
|
59
60
|
if request.keep_alive?
|
60
61
|
change_state(:success)
|
61
62
|
dettach(conn)
|
62
63
|
operation.success!(response, operation, connection)
|
63
64
|
else
|
64
|
-
client.
|
65
|
+
client.stop
|
65
66
|
end
|
66
67
|
end
|
67
68
|
|
@@ -99,6 +100,7 @@ module EmmyHttp
|
|
99
100
|
self.response = nil
|
100
101
|
parser.reset!
|
101
102
|
operation.reconnect
|
103
|
+
return
|
102
104
|
end
|
103
105
|
|
104
106
|
if response && response.finished?
|
@@ -107,7 +109,7 @@ module EmmyHttp
|
|
107
109
|
operation.success!(response, operation, connection)
|
108
110
|
else
|
109
111
|
change_state(:catch_error)
|
110
|
-
operation.error!('
|
112
|
+
operation.error!(reason.new.to_s || 'Invalid response')
|
111
113
|
end
|
112
114
|
end
|
113
115
|
|
@@ -169,7 +171,7 @@ module EmmyHttp
|
|
169
171
|
|
170
172
|
unless headers.key? 'Host'
|
171
173
|
headers['Host'] = url.host
|
172
|
-
headers['Host'] += ":#{
|
174
|
+
headers['Host'] += ":#{url.port}" unless (url.scheme == 'http' && url.port == 80) ||
|
173
175
|
(url.scheme == 'https' && url.port == 443)
|
174
176
|
end
|
175
177
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emmy-http-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- inre
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http_parser.rb
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.1.7
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: emmy-http
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.6
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.6
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|