protocol-http 0.23.9 → 0.23.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51808eff2467e7492a795e4ad1f8901649fdc6b7e6fec19cd8a49072bb461c96
4
- data.tar.gz: 7f2622ac1894b8bffcf54934264465f6cf4de11c30976a707720558fcdd519c7
3
+ metadata.gz: 4cae774ef59f117617900a2b230789cdeb05c4eb7a5ec37fe92a9fd9ecfdd960
4
+ data.tar.gz: 323033ee1461a0690f5dfb130b0a710b89358c65097e0759031df5a54b5a8175
5
5
  SHA512:
6
- metadata.gz: e592bad7c0e72a312f95a012f3ac185de4bd04e611e0c792792a72eeccce0f63e5acc150f5bf7d6a82c29b6580292e82bbdbf8e017c114b9c2bc6aac51cf6222
7
- data.tar.gz: 871ce95050b3242c57c1db9e4575146cb2569134c0a901a481a06e689688eec0c04deb2d9ae84181acf53f4f926ea71e6ad08ac6b9cd09b2a8a68f5e7688fbe8
6
+ metadata.gz: d8a9a03e66bd5f3a31e73646d5defc3faa5e05324927ae0c999bb66d2767461a35cd7e5d394ed34a4e24bdbcddcf2186a910e1137e3c4dfd989d3ec420e973c3
7
+ data.tar.gz: 2b9a8c75c3775f52d3ad711b1565e4db6b2b03968c240c0f5f7fccd365bde27f69ee9d3f9754ace710172eb4edd91a9c5f890adfa1a7e523a0db1be44d806d36
checksums.yaml.gz.sig CHANGED
Binary file
@@ -89,6 +89,12 @@ module Protocol
89
89
  self.new(body, Zlib::Deflate.new(level, window_size))
90
90
  end
91
91
 
92
+ def stream?
93
+ # We might want to revisit this design choice.
94
+ # We could wrap the streaming body in a Deflate stream, but that would require an extra stream wrapper which we don't have right now. See also `Digestable#stream?`.
95
+ false
96
+ end
97
+
92
98
  def read
93
99
  return if @stream.finished?
94
100
 
@@ -50,6 +50,10 @@ module Protocol
50
50
  @digest.hexdigest.dump
51
51
  end
52
52
 
53
+ def stream?
54
+ false
55
+ end
56
+
53
57
  def read
54
58
  if chunk = super
55
59
  @digest.update(chunk)
@@ -73,6 +73,10 @@ module Protocol
73
73
  @file.seek(@offset)
74
74
  end
75
75
 
76
+ def stream?
77
+ false
78
+ end
79
+
76
80
  def read
77
81
  if @remaining > 0
78
82
  amount = [@remaining, @block_size].min
@@ -32,6 +32,10 @@ module Protocol
32
32
  self.new(body, Zlib::Inflate.new(encoding))
33
33
  end
34
34
 
35
+ def stream?
36
+ false
37
+ end
38
+
35
39
  def read
36
40
  return if @stream.finished?
37
41
 
@@ -48,6 +48,10 @@ module Protocol
48
48
  Buffered.new(@chunks)
49
49
  end
50
50
 
51
+ def stream?
52
+ false
53
+ end
54
+
51
55
  def read
52
56
  if @index < @chunks.size
53
57
  chunk = @chunks[@index]
@@ -151,7 +151,13 @@ module Protocol
151
151
  end
152
152
  end
153
153
 
154
- alias write_nonblock write
154
+ def write_nonblock(buffer)
155
+ write(buffer)
156
+ end
157
+
158
+ def <<(buffer)
159
+ write(buffer)
160
+ end
155
161
 
156
162
  def flush
157
163
  end
@@ -157,6 +157,8 @@ module Protocol
157
157
  self[key] != nil
158
158
  end
159
159
 
160
+ alias key? include?
161
+
160
162
  def keys
161
163
  self.to_h.keys
162
164
  end
@@ -25,15 +25,6 @@ require_relative '../middleware'
25
25
  module Protocol
26
26
  module HTTP
27
27
  class Middleware
28
- module NotFound
29
- def self.close
30
- end
31
-
32
- def self.call(request)
33
- Response[404, Headers[], []]
34
- end
35
- end
36
-
37
28
  class Builder
38
29
  def initialize(default_app = NotFound)
39
30
  @use = []
@@ -55,25 +55,25 @@ module Protocol
55
55
  end
56
56
 
57
57
  def self.call(request)
58
- Response[200, {}, []]
58
+ Response[200]
59
59
  end
60
60
  end
61
61
 
62
- module HelloWorld
62
+ module NotFound
63
63
  def self.close
64
64
  end
65
65
 
66
66
  def self.call(request)
67
- Response[200, Headers['content-type' => 'text/plain'], ["Hello World!"]]
67
+ Response[404]
68
68
  end
69
69
  end
70
70
 
71
- module NotFound
71
+ module HelloWorld
72
72
  def self.close
73
73
  end
74
74
 
75
75
  def self.call(request)
76
- Response[404, Headers[], []]
76
+ Response[200, Headers['content-type' => 'text/plain'], ["Hello World!"]]
77
77
  end
78
78
  end
79
79
  end
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Protocol
24
24
  module HTTP
25
- VERSION = "0.23.9"
25
+ VERSION = "0.23.12"
26
26
  end
27
27
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.9
4
+ version: 0.23.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -41,7 +41,7 @@ cert_chain:
41
41
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
42
42
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
43
43
  -----END CERTIFICATE-----
44
- date: 2022-08-27 00:00:00.000000000 Z
44
+ date: 2022-08-31 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: bundler
metadata.gz.sig CHANGED
Binary file