protocol-http 0.23.11 → 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: 9545141abc2607b219662d4bac1bfda0fe878948e043efd1352422ffd36f53f3
4
- data.tar.gz: 1ae4a8438b15dc1507134ff403089fb4512f4d69b1505fc2a0d8d94f1ae6fb68
3
+ metadata.gz: 4cae774ef59f117617900a2b230789cdeb05c4eb7a5ec37fe92a9fd9ecfdd960
4
+ data.tar.gz: 323033ee1461a0690f5dfb130b0a710b89358c65097e0759031df5a54b5a8175
5
5
  SHA512:
6
- metadata.gz: ed6aba47c9faa13bc6350b4d8b3132f7ca19c162675e91621fd64c1215e6986d817cf65959ec0e68fca3a63b8101e8110a57045b4544af42a7165f9a04a0b463
7
- data.tar.gz: 95b109acf30ac7b93c3abe0cfa02d40bffba865be594efcbfe86fadd97efadf5b04586fc4c9b214a880ebf6e870cb734d97627e812b4f5ed7cc74b13a9f1a7df
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]
@@ -155,7 +155,7 @@ module Protocol
155
155
  write(buffer)
156
156
  end
157
157
 
158
- def << (buffer)
158
+ def <<(buffer)
159
159
  write(buffer)
160
160
  end
161
161
 
@@ -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.11"
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.11
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-30 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