protocol-http1 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/http1/body/chunked.rb +2 -1
- data/lib/protocol/http1/connection.rb +24 -3
- data/lib/protocol/http1/version.rb +1 -1
- data/license.md +1 -0
- data/readme.md +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d4495522852a254da8e7864cc481d08b807df88e786eafe2e40b2a87ac512ae
|
4
|
+
data.tar.gz: 9f505c0853068baaf3eb4871c10f782b03e9221437254d61d3741b5430ed81ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d727d33628c7cb500738fd0bb090ca32d3b2cffad056d4c0d6032bc2b619e6c35f511ce383c9155bbc214e487cce6a5a34a372671c8173a344cd73315946f07
|
7
|
+
data.tar.gz: 4ab44f130d572da7dd2cacc96ea476aa07b4072fc4489ce5aeaaf0b226b99287d1af37c3e52f4a5ffcb12e5acd0bd1ede3fcb34cb199b0eb554909684a15787f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# Copyright, 2019-2023, by Samuel Williams.
|
5
5
|
# Copyright, 2019, by Brian Morearty.
|
6
6
|
# Copyright, 2020, by Bruno Sutic.
|
7
|
+
# Copyright, 2023, by Thomas Morgan.
|
7
8
|
|
8
9
|
require 'protocol/http/headers'
|
9
10
|
|
@@ -59,7 +60,14 @@ module Protocol
|
|
59
60
|
attr :stream
|
60
61
|
|
61
62
|
# Whether the connection is persistent.
|
62
|
-
|
63
|
+
# This determines what connection headers are sent in the response and whether
|
64
|
+
# the connection can be reused after the response is sent.
|
65
|
+
# This setting is automatically managed according to the nature of the request
|
66
|
+
# and response.
|
67
|
+
# Changing to false is safe.
|
68
|
+
# Changing to true from outside this class should generally be avoided and,
|
69
|
+
# depending on the response semantics, may be reset to false anyway.
|
70
|
+
attr_accessor :persistent
|
63
71
|
|
64
72
|
# The number of requests processed.
|
65
73
|
attr :count
|
@@ -165,7 +173,7 @@ module Protocol
|
|
165
173
|
read_line? or raise EOFError
|
166
174
|
end
|
167
175
|
|
168
|
-
def
|
176
|
+
def read_request_line
|
169
177
|
return unless line = read_line?
|
170
178
|
|
171
179
|
if match = line.match(REQUEST_LINE)
|
@@ -174,6 +182,13 @@ module Protocol
|
|
174
182
|
raise InvalidRequest, line.inspect
|
175
183
|
end
|
176
184
|
|
185
|
+
return method, path, version
|
186
|
+
end
|
187
|
+
|
188
|
+
def read_request
|
189
|
+
method, path, version = read_request_line
|
190
|
+
return unless method
|
191
|
+
|
177
192
|
headers = read_headers
|
178
193
|
|
179
194
|
@persistent = persistent?(version, method, headers)
|
@@ -185,11 +200,17 @@ module Protocol
|
|
185
200
|
return headers.delete(HOST), method, path, version, headers, body
|
186
201
|
end
|
187
202
|
|
188
|
-
def
|
203
|
+
def read_response_line
|
189
204
|
version, status, reason = read_line.split(/\s+/, 3)
|
190
205
|
|
191
206
|
status = Integer(status)
|
192
207
|
|
208
|
+
return version, status, reason
|
209
|
+
end
|
210
|
+
|
211
|
+
def read_response(method)
|
212
|
+
version, status, reason = read_response_line
|
213
|
+
|
193
214
|
headers = read_headers
|
194
215
|
|
195
216
|
@persistent = persistent?(version, method, headers)
|
data/license.md
CHANGED
@@ -4,6 +4,7 @@ Copyright, 2019-2023, by Samuel Williams.
|
|
4
4
|
Copyright, 2019, by Brian Morearty.
|
5
5
|
Copyright, 2020, by Olle Jonsson.
|
6
6
|
Copyright, 2020, by Bruno Sutic.
|
7
|
+
Copyright, 2023, by Thomas Morgan.
|
7
8
|
|
8
9
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
10
|
of this software and associated documentation files (the "Software"), to deal
|
data/readme.md
CHANGED
@@ -75,4 +75,4 @@ This project uses the [Developer Certificate of Origin](https://developercertifi
|
|
75
75
|
|
76
76
|
### Contributor Covenant
|
77
77
|
|
78
|
-
This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
78
|
+
This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
+
- Thomas Morgan
|
8
9
|
- Brian Morearty
|
9
10
|
- Bruno Sutic
|
10
11
|
- Olle Jonsson
|
@@ -40,7 +41,7 @@ cert_chain:
|
|
40
41
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
41
42
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
42
43
|
-----END CERTIFICATE-----
|
43
|
-
date: 2023-
|
44
|
+
date: 2023-12-26 00:00:00.000000000 Z
|
44
45
|
dependencies:
|
45
46
|
- !ruby/object:Gem::Dependency
|
46
47
|
name: protocol-http
|
@@ -84,7 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
85
|
requirements:
|
85
86
|
- - ">="
|
86
87
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
88
|
+
version: '3.0'
|
88
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
90
|
requirements:
|
90
91
|
- - ">="
|
metadata.gz.sig
CHANGED
Binary file
|