protocol-http1 0.16.0 → 0.16.1
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: f969e504112849ed6eccb047bd8e240fc79dc92efd2835f8676469064fe2656c
|
4
|
+
data.tar.gz: 25ffd9feeede23158051a130c5047f80a1f6f72b5c438e9adbc7fc1296add536
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b40ee03ea89a7daf74e3e93a441b2ff2f1933657bb95440682d9eacf85487523a38a7fe1ef5aed251a2d784f0fd8b5cb87d674561a579b1f928ef104b7ef5d7
|
7
|
+
data.tar.gz: 7063c346d1de2461b0ad5ee40aaa9b3992f0eb37f5930ba62869bc1b01df0d3c91b268e65a757bb98026b740036796a3e42a85add7bd7421a2e098bdd79a4fd0
|
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.16.
|
4
|
+
version: 0.16.1
|
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
|