http-protocol 0.11.0 → 0.12.0
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 +4 -4
- data/lib/http/protocol/http1/connection.rb +6 -3
- data/lib/http/protocol/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c0a403cce8ef69b3472473b71ed1c5a0813e5425b53d23fedd577a26d5b1ce4
|
4
|
+
data.tar.gz: ca9d3cecbd5ff3acab7dd415eb0e0010715a3d1fae75b76b0d84deeea36d13d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cf350b028363e71fdc7ec38d2002657c04bb386aba889b3b6e1d62c0a26b7da3141be0c7bd937fd03164e34c46ecb5397bdde26fe3b6897762709861bdc2ac3
|
7
|
+
data.tar.gz: d05ca95939bfe457fe945876b85b258c40e0f5265e7bf98b631c01800b9e946cb238e2927680fd00789d59ec46b13d5f3088b8abd9d56403e6e04c599d1967ac
|
@@ -90,8 +90,6 @@ module HTTP
|
|
90
90
|
|
91
91
|
write_headers(headers)
|
92
92
|
write_persistent_header(version)
|
93
|
-
|
94
|
-
@stream.flush
|
95
93
|
end
|
96
94
|
|
97
95
|
def write_response(version, status, headers, body = nil, head = false)
|
@@ -187,6 +185,7 @@ module HTTP
|
|
187
185
|
|
188
186
|
def write_empty_body(body)
|
189
187
|
@stream.write("content-length: 0\r\n\r\n")
|
188
|
+
@stream.flush
|
190
189
|
|
191
190
|
if body
|
192
191
|
body.close if body.respond_to?(:close)
|
@@ -195,6 +194,7 @@ module HTTP
|
|
195
194
|
|
196
195
|
def write_fixed_length_body(body, length, head)
|
197
196
|
@stream.write("content-length: #{length}\r\n\r\n")
|
197
|
+
@stream.flush
|
198
198
|
|
199
199
|
if head
|
200
200
|
body.close if body.respond_to?(:close)
|
@@ -222,6 +222,7 @@ module HTTP
|
|
222
222
|
|
223
223
|
def write_chunked_body(body, head)
|
224
224
|
@stream.write("transfer-encoding: chunked\r\n\r\n")
|
225
|
+
@stream.flush
|
225
226
|
|
226
227
|
if head
|
227
228
|
body.close if body.respond_to?(:close)
|
@@ -239,12 +240,14 @@ module HTTP
|
|
239
240
|
end
|
240
241
|
|
241
242
|
@stream.write("0\r\n\r\n")
|
243
|
+
@stream.flush
|
242
244
|
end
|
243
245
|
|
244
246
|
def write_body_and_close(body, head)
|
245
247
|
# We can't be persistent because we don't know the data length:
|
246
248
|
@persistent = false
|
247
249
|
@stream.write("\r\n")
|
250
|
+
@stream.flush
|
248
251
|
|
249
252
|
if head
|
250
253
|
body.close if body.respond_to?(:close)
|
@@ -255,7 +258,7 @@ module HTTP
|
|
255
258
|
end
|
256
259
|
end
|
257
260
|
|
258
|
-
@stream.
|
261
|
+
@stream.io.close_write
|
259
262
|
end
|
260
263
|
|
261
264
|
def write_body(body, chunked = true, head = false)
|