tipi 0.51 → 0.53

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: 6338c894cec0a59a270a7c75535441ab6be2c8a6fbb5457b8ecfd200ade25b92
4
- data.tar.gz: 620303ca676af631574e678ca8e43f3af679d6c2dddbaeb29b1a1e3c3f3fe716
3
+ metadata.gz: 44086c5429ced53ce6171972cf76cbb1d264a05947885967f8708bda28bc249a
4
+ data.tar.gz: 38b0d03948e48d7b81528552a1ea613d65a85d5eba593b255b5083c52d815f04
5
5
  SHA512:
6
- metadata.gz: 2fc80e081f7f933ab2f2f352aae042e0cd396942b460c2061a6064b2ba90c31011c8e8632a3abebc17c8904b7406164b9771d2a0645b868a6de0d79b0a296c67
7
- data.tar.gz: 295b6f82fc7a1bbc4e5b15e8c49732aa05d66b0b366ad93aa310c17b7be727a71f179f68358e5905d06efa29ad0b2f8a95d948f7625ea9455dac74b1b32f023e
6
+ metadata.gz: e29e79ee1d44d228bbbe98757a6ac7b3e802eee2d4476125942cabe11b98f8b3584cf5bce7313def080123fd02c7d0cd387aa033b271e279a2105868ddff1e15
7
+ data.tar.gz: f2b17b8d1b6df52bf16548eb76c5a9e072b91170ee28dced8ba4b2be2bcf4375898826a6d214693bd0bed75bfd0dfac040317b9c5f812063e47028ae901b6388
@@ -16,7 +16,7 @@ jobs:
16
16
  runs-on: ${{matrix.os}}
17
17
 
18
18
  env:
19
- POLYPHONY_USE_LIBEV: "1"
19
+ POLYPHONY_LIBEV: "1"
20
20
 
21
21
  steps:
22
22
  - name: Setup machine
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.52 2022-03-03
2
+
3
+ - Treat HTTP/2 headers as immutable
4
+
1
5
  ## 0.51 2022-02-28
2
6
 
3
7
  - Update dependencies
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tipi (0.51)
4
+ tipi (0.53)
5
5
  acme-client (~> 2.0.9)
6
6
  ever (~> 0.1)
7
- extralite (~> 1.14)
8
- h1p (~> 0.4)
7
+ extralite (~> 1.16)
8
+ h1p (~> 0.5)
9
9
  http-2 (~> 0.11)
10
10
  localhost (~> 1.1.4)
11
11
  msgpack (~> 1.4.2)
12
- polyphony (~> 0.80)
12
+ polyphony (~> 0.94)
13
13
  qeweney (~> 0.18)
14
14
  rack (>= 2.0.8, < 2.3.0)
15
15
  websocket (~> 1.2.8)
@@ -17,49 +17,31 @@ PATH
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- acme-client (2.0.9)
21
- faraday (>= 0.17, < 2.0.0)
20
+ acme-client (2.0.11)
21
+ faraday (>= 1.0, < 3.0.0)
22
+ faraday-retry (~> 1.0)
22
23
  cuba (3.9.3)
23
24
  rack (>= 1.6.0)
24
25
  docile (1.4.0)
25
- escape_utils (1.2.1)
26
- ever (0.1)
27
- extralite (1.14)
28
- faraday (1.10.0)
29
- faraday-em_http (~> 1.0)
30
- faraday-em_synchrony (~> 1.0)
31
- faraday-excon (~> 1.1)
32
- faraday-httpclient (~> 1.0)
33
- faraday-multipart (~> 1.0)
34
- faraday-net_http (~> 1.0)
35
- faraday-net_http_persistent (~> 1.0)
36
- faraday-patron (~> 1.0)
37
- faraday-rack (~> 1.0)
38
- faraday-retry (~> 1.0)
26
+ escape_utils (1.2.2)
27
+ ever (0.2)
28
+ extralite (1.16)
29
+ faraday (2.6.0)
30
+ faraday-net_http (>= 2.0, < 3.1)
39
31
  ruby2_keywords (>= 0.0.4)
40
- faraday-em_http (1.0.0)
41
- faraday-em_synchrony (1.0.0)
42
- faraday-excon (1.1.0)
43
- faraday-httpclient (1.0.1)
44
- faraday-multipart (1.0.3)
45
- multipart-post (>= 1.2, < 3)
46
- faraday-net_http (1.0.1)
47
- faraday-net_http_persistent (1.2.0)
48
- faraday-patron (1.0.0)
49
- faraday-rack (1.0.0)
32
+ faraday-net_http (3.0.0)
50
33
  faraday-retry (1.0.3)
51
- h1p (0.4)
34
+ h1p (0.5)
52
35
  http-2 (0.11.0)
53
- json (2.6.1)
36
+ json (2.6.2)
54
37
  localhost (1.1.9)
55
38
  memory_profiler (1.0.0)
56
39
  minitest (5.11.3)
57
40
  msgpack (1.4.5)
58
- multipart-post (2.1.1)
59
- polyphony (0.80)
41
+ polyphony (0.94)
60
42
  qeweney (0.18)
61
43
  escape_utils (~> 1.2.1)
62
- rack (2.2.3)
44
+ rack (2.2.4)
63
45
  rake (13.0.6)
64
46
  ruby2_keywords (0.0.5)
65
47
  simplecov (0.17.1)
@@ -113,21 +113,19 @@ module Tipi
113
113
  end
114
114
 
115
115
  # response API
116
- def respond(request, chunk, headers)
117
- headers[':status'] ||= Qeweney::Status::OK
118
- headers[':status'] = headers[':status'].to_s
116
+ def respond(request, body, headers)
117
+ headers = normalize_status_header(headers)
119
118
  with_transfer_count(request) do
120
119
  @stream.headers(transform_headers(headers))
121
120
  @headers_sent = true
122
- @stream.data(chunk || '')
121
+ @stream.data(body || '')
123
122
  end
124
123
  rescue HTTP2::Error::StreamClosed
125
124
  # ignore
126
125
  end
127
126
 
128
127
  def respond_from_io(request, io, headers, chunk_size = 2**16)
129
- headers[':status'] ||= Qeweney::Status::OK
130
- headers[':status'] = headers[':status'].to_s
128
+ headers = normalize_status_header(headers)
131
129
  with_transfer_count(request) do
132
130
  @stream.headers(transform_headers(headers))
133
131
  @headers_sent = true
@@ -152,7 +150,8 @@ module Tipi
152
150
  def send_headers(request, headers, empty_response: false)
153
151
  return if @headers_sent
154
152
 
155
- headers[':status'] ||= (empty_response ? Qeweney::Status::NO_CONTENT : Qeweney::Status::OK).to_s
153
+ status = empty_response ? Qeweney::Status::NO_CONTENT : Qeweney::Status::OK
154
+ headers = normalize_status_header(headers, status)
156
155
  with_transfer_count(request) do
157
156
  @stream.headers(transform_headers(headers), end_stream: false)
158
157
  end
@@ -194,5 +193,17 @@ module Tipi
194
193
  @stream.close
195
194
  @stream_fiber.schedule(Polyphony::MoveOn.new)
196
195
  end
196
+
197
+ private
198
+
199
+ def normalize_status_header(headers, default_status = Qeweney::Status::OK)
200
+ if !headers[':status']
201
+ headers.merge(':status' => default_status.to_s)
202
+ elsif !headers[':status'].is_a?(String)
203
+ headers.merge(headers[':status'].to_s)
204
+ else
205
+ headers
206
+ end
207
+ end
197
208
  end
198
209
  end
data/lib/tipi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tipi
4
- VERSION = '0.51'
4
+ VERSION = '0.53'
5
5
  end
data/lib/tipi.rb CHANGED
@@ -48,6 +48,8 @@ module Tipi
48
48
  client.no_delay if client.respond_to?(:no_delay)
49
49
  adapter = protocol_adapter(client, opts)
50
50
  adapter.each(&handler)
51
+ rescue SystemCallError
52
+ # disregard
51
53
  ensure
52
54
  client.close rescue nil
53
55
  end
data/tipi.gemspec CHANGED
@@ -22,11 +22,11 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.executables = ['tipi']
24
24
 
25
- s.add_runtime_dependency 'polyphony', '~>0.80'
25
+ s.add_runtime_dependency 'polyphony', '~>0.94'
26
26
  s.add_runtime_dependency 'ever', '~>0.1'
27
27
  s.add_runtime_dependency 'qeweney', '~>0.18'
28
- s.add_runtime_dependency 'extralite', '~>1.14'
29
- s.add_runtime_dependency 'h1p', '~>0.4'
28
+ s.add_runtime_dependency 'extralite', '~>1.16'
29
+ s.add_runtime_dependency 'h1p', '~>0.5'
30
30
 
31
31
  s.add_runtime_dependency 'http-2', '~>0.11'
32
32
  s.add_runtime_dependency 'rack', '>=2.0.8', '<2.3.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tipi
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.51'
4
+ version: '0.53'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-28 00:00:00.000000000 Z
11
+ date: 2022-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: polyphony
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.80'
19
+ version: '0.94'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.80'
26
+ version: '0.94'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ever
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.14'
61
+ version: '1.16'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.14'
68
+ version: '1.16'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: h1p
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.4'
75
+ version: '0.5'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.4'
82
+ version: '0.5'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: http-2
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -377,7 +377,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
377
377
  - !ruby/object:Gem::Version
378
378
  version: '0'
379
379
  requirements: []
380
- rubygems_version: 3.1.6
380
+ rubygems_version: 3.3.7
381
381
  signing_key:
382
382
  specification_version: 4
383
383
  summary: Tipi - the All-in-one Web Server for Ruby Apps