protocol-http1 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of protocol-http1 might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/protocol/http1/connection.rb +9 -5
- data/lib/protocol/http1/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 815238149caf3e1fd7ee9f4c049488bd3eba0f669ed98a0491ad26d68b854157
|
4
|
+
data.tar.gz: d5d7cf91e4c19039ca8dbe506bd51d3c3f2ecb106c3e73f77a737068be8ea8db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09c9c15b227b3c2c23adf7175c1b5610a31869dcac60b819870a51e2828ec78929e9210e210cb71a9c32f4ef95f07cd7f30c0320ee97893c8cf0994d503faff6'
|
7
|
+
data.tar.gz: 95252b355145060621c4c47fa367d37a3c3bf2d1155bafcee3bd921eb8f3c9d3a542750d5ddbf7038fd5bbee3276b1cc5e80545c3347f99443e283ffe7aaf814
|
@@ -84,9 +84,10 @@ module Protocol
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def upgrade!(protocol)
|
87
|
-
@upgrade = protocol
|
88
87
|
@persistent = false
|
89
88
|
|
89
|
+
@upgrade = protocol
|
90
|
+
|
90
91
|
return @stream
|
91
92
|
end
|
92
93
|
|
@@ -212,14 +213,17 @@ module Protocol
|
|
212
213
|
return chunk
|
213
214
|
end
|
214
215
|
|
215
|
-
def write_upgrade_body
|
216
|
+
def write_upgrade_body(body = nil)
|
217
|
+
# Any time we are potentially closing the stream, we should ensure no further requests are processed:
|
218
|
+
@persistent = false
|
219
|
+
|
216
220
|
@stream.write("\r\n")
|
217
221
|
@stream.flush
|
218
222
|
|
219
|
-
return @stream unless
|
223
|
+
return @stream unless body
|
220
224
|
|
221
225
|
begin
|
222
|
-
|
226
|
+
body.call(@stream)
|
223
227
|
rescue
|
224
228
|
@stream.close_write
|
225
229
|
end
|
@@ -307,7 +311,7 @@ module Protocol
|
|
307
311
|
if body.nil? or body.empty?
|
308
312
|
write_empty_body(body)
|
309
313
|
elsif body.respond_to?(:call)
|
310
|
-
write_upgrade_body(
|
314
|
+
write_upgrade_body(body)
|
311
315
|
elsif length = body.length
|
312
316
|
write_fixed_length_body(body, length, head)
|
313
317
|
elsif @persistent and chunked
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: protocol-http
|