tipi 0.51 → 0.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/lib/tipi/http2_stream.rb +18 -7
- data/lib/tipi/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: efec664af01dfb4781c30670e2471a591a6c8df3a8024b5f14dc4edded3f5c1d
|
4
|
+
data.tar.gz: 0f384c5a305c5afe524b9a0e28d2a06931340275fe879e963cc194d2cde3c766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa3995cd7ad560f3ba0f8a318da6c5ef62d53bc02209f05491f1e3db5b140e2697e8cd3158686a62c3dbae373d0260d803befabf4b8c417e862f2e6f68860bf
|
7
|
+
data.tar.gz: 7a17368c2fd9572531ac137822727082e48b85322190b91197f699d34d0554fd39d5dc7a18fe6f68bf8ea64dadbabbb464f39fa2b83475ee52cee99484c422a5
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tipi (0.
|
4
|
+
tipi (0.52)
|
5
5
|
acme-client (~> 2.0.9)
|
6
6
|
ever (~> 0.1)
|
7
7
|
extralite (~> 1.14)
|
@@ -56,7 +56,7 @@ GEM
|
|
56
56
|
minitest (5.11.3)
|
57
57
|
msgpack (1.4.5)
|
58
58
|
multipart-post (2.1.1)
|
59
|
-
polyphony (0.
|
59
|
+
polyphony (0.81)
|
60
60
|
qeweney (0.18)
|
61
61
|
escape_utils (~> 1.2.1)
|
62
62
|
rack (2.2.3)
|
data/lib/tipi/http2_stream.rb
CHANGED
@@ -113,21 +113,19 @@ module Tipi
|
|
113
113
|
end
|
114
114
|
|
115
115
|
# response API
|
116
|
-
def respond(request,
|
117
|
-
headers
|
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(
|
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
|
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
|
-
|
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
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.
|
4
|
+
version: '0.52'
|
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-
|
11
|
+
date: 2022-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: polyphony
|