http 1.0.0.pre4 → 1.0.0.pre5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -1
- data/lib/http/request/writer.rb +13 -11
- data/lib/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ee1ca0916164aded3b9b12560622a11207255cd
|
4
|
+
data.tar.gz: 441afd2c8d51450678c3520459f9d21007a306cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f22db552865424b796f4cf2c96e4b285befee9397825a8cfc8cf389d0c6f98adb0f701dd46cf60449f017f54b76d6196cd5f4c9df547b629fedd3ab7bfb56275
|
7
|
+
data.tar.gz: 38b12a78b17f7fa5b97a0f89a25e5d44c282895dc73871dd39dc2548d4d2734eb04379ff6738dcf6567b0231cf6afe13084637b1cea662fb61c231aa17b86da2
|
data/CHANGES.md
CHANGED
@@ -35,9 +35,13 @@
|
|
35
35
|
([@tarcieri])
|
36
36
|
|
37
37
|
* [#278](https://github.com/httprb/http/pull/278)
|
38
|
-
Use an options hash for HTTP::Request
|
38
|
+
Use an options hash for HTTP::Request initializer API.
|
39
39
|
([@ixti])
|
40
40
|
|
41
|
+
* [#279](https://github.com/httprb/http/pull/279)
|
42
|
+
Send headers and body in one write if possible.
|
43
|
+
This avoids a pathological case in Nagle's algorithm.
|
44
|
+
([@tarcieri])
|
41
45
|
|
42
46
|
## 0.9.8 (2015-09-29)
|
43
47
|
|
data/lib/http/request/writer.rb
CHANGED
@@ -36,8 +36,9 @@ module HTTP
|
|
36
36
|
|
37
37
|
# Stream the request to a socket
|
38
38
|
def stream
|
39
|
-
|
40
|
-
|
39
|
+
add_headers
|
40
|
+
add_body_type_headers
|
41
|
+
send_request
|
41
42
|
end
|
42
43
|
|
43
44
|
# Send headers needed to connect through proxy
|
@@ -64,23 +65,24 @@ module HTTP
|
|
64
65
|
@request_header.join(CRLF) + (CRLF) * 2
|
65
66
|
end
|
66
67
|
|
67
|
-
def
|
68
|
-
|
69
|
-
add_body_type_headers
|
68
|
+
def send_request
|
69
|
+
headers = join_headers
|
70
70
|
|
71
|
-
|
72
|
-
|
71
|
+
case @body
|
72
|
+
when NilClass
|
73
|
+
write(headers)
|
74
|
+
when String
|
75
|
+
write(headers << @body)
|
76
|
+
when Enumerable
|
77
|
+
write(headers)
|
73
78
|
|
74
|
-
def send_request_body
|
75
|
-
if @body.is_a?(String)
|
76
|
-
write(@body)
|
77
|
-
elsif @body.is_a?(Enumerable)
|
78
79
|
@body.each do |chunk|
|
79
80
|
write(chunk.bytesize.to_s(16) << CRLF)
|
80
81
|
write(chunk << CRLF)
|
81
82
|
end
|
82
83
|
|
83
84
|
write(CHUNKED_END)
|
85
|
+
else fail TypeError, "invalid body type: #{@body.class}"
|
84
86
|
end
|
85
87
|
end
|
86
88
|
|
data/lib/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pre5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-12-
|
14
|
+
date: 2015-12-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: http_parser.rb
|