protocol-http1 0.15.0 → 0.15.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 +9 -1
- data/lib/protocol/http1/connection.rb +4 -2
- data/lib/protocol/http1/version.rb +2 -2
- data/readme.md +15 -29
- data.tar.gz.sig +0 -0
- metadata +4 -46
- 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: 628996f62e649fce9998463a3147bba9690074ccd422d8973b56840f169ddbef
|
4
|
+
data.tar.gz: 368fd3265a87abe2f0300741f568194d5f479121fd49ccf51e0fdce6725dd080
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3b589a20fb9395b6245ace8b113b7c57f541e9077562cece7673e8ba3577c0825bc71ed229902447e7abc735e126e6d2cd7a2b4a5b9385e24b5e5fb7c3596da
|
7
|
+
data.tar.gz: 15ff254cb06790546e76b00de892c10e712eb42ca30629b9c527d90034c252993c9de71be6d6b9f3f0cb26745ab554cf71e75e63e18a8b847c510d2bad16d45c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -35,12 +35,20 @@ module Protocol
|
|
35
35
|
super
|
36
36
|
end
|
37
37
|
|
38
|
+
VALID_CHUNK_LENGTH = /\A[0-9a-fA-F]+\z/
|
39
|
+
|
38
40
|
# Follows the procedure outlined in https://tools.ietf.org/html/rfc7230#section-4.1.3
|
39
41
|
def read
|
40
42
|
return nil if @finished
|
41
43
|
|
44
|
+
length, extensions = read_line.split(";", 2)
|
45
|
+
|
46
|
+
unless length =~ VALID_CHUNK_LENGTH
|
47
|
+
raise BadRequest, "Invalid chunk length: #{length.dump}"
|
48
|
+
end
|
49
|
+
|
42
50
|
# It is possible this line contains chunk extension, so we use `to_i` to only consider the initial integral part:
|
43
|
-
length =
|
51
|
+
length = Integer(length, 16)
|
44
52
|
|
45
53
|
if length == 0
|
46
54
|
@finished = true
|
@@ -398,10 +398,12 @@ module Protocol
|
|
398
398
|
HEAD = "HEAD"
|
399
399
|
CONNECT = "CONNECT"
|
400
400
|
|
401
|
+
VALID_CONTENT_LENGTH = /\A\d+\z/
|
402
|
+
|
401
403
|
def extract_content_length(headers)
|
402
404
|
if content_length = headers.delete(CONTENT_LENGTH)
|
403
|
-
if
|
404
|
-
yield
|
405
|
+
if content_length =~ VALID_CONTENT_LENGTH
|
406
|
+
yield Integer(content_length, 10)
|
405
407
|
else
|
406
408
|
raise BadRequest, "Invalid content length: #{content_length}"
|
407
409
|
end
|
data/readme.md
CHANGED
@@ -61,32 +61,18 @@ end
|
|
61
61
|
|
62
62
|
## Contributing
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
80
|
-
copies of the Software, and to permit persons to whom the Software is
|
81
|
-
furnished to do so, subject to the following conditions:
|
82
|
-
|
83
|
-
The above copyright notice and this permission notice shall be included in
|
84
|
-
all copies or substantial portions of the Software.
|
85
|
-
|
86
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
87
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
88
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
89
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
90
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
91
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
92
|
-
THE SOFTWARE.
|
64
|
+
We welcome contributions to this project.
|
65
|
+
|
66
|
+
1. Fork it.
|
67
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
68
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
69
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
70
|
+
5. Create new Pull Request.
|
71
|
+
|
72
|
+
### Developer Certificate of Origin
|
73
|
+
|
74
|
+
This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
|
75
|
+
|
76
|
+
### Contributor Covenant
|
77
|
+
|
78
|
+
This project is governed by [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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -40,7 +40,7 @@ cert_chain:
|
|
40
40
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
41
41
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
42
42
|
-----END CERTIFICATE-----
|
43
|
-
date: 2023-
|
43
|
+
date: 2023-07-30 00:00:00.000000000 Z
|
44
44
|
dependencies:
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: protocol-http
|
@@ -56,48 +56,6 @@ dependencies:
|
|
56
56
|
- - "~>"
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0.22'
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: bundler
|
61
|
-
requirement: !ruby/object:Gem::Requirement
|
62
|
-
requirements:
|
63
|
-
- - ">="
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version: '0'
|
66
|
-
type: :development
|
67
|
-
prerelease: false
|
68
|
-
version_requirements: !ruby/object:Gem::Requirement
|
69
|
-
requirements:
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: '0'
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: covered
|
75
|
-
requirement: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
77
|
-
- - ">="
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: '0'
|
80
|
-
type: :development
|
81
|
-
prerelease: false
|
82
|
-
version_requirements: !ruby/object:Gem::Requirement
|
83
|
-
requirements:
|
84
|
-
- - ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '0'
|
87
|
-
- !ruby/object:Gem::Dependency
|
88
|
-
name: sus
|
89
|
-
requirement: !ruby/object:Gem::Requirement
|
90
|
-
requirements:
|
91
|
-
- - ">="
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
type: :development
|
95
|
-
prerelease: false
|
96
|
-
version_requirements: !ruby/object:Gem::Requirement
|
97
|
-
requirements:
|
98
|
-
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '0'
|
101
59
|
description:
|
102
60
|
email:
|
103
61
|
executables: []
|
@@ -126,14 +84,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
84
|
requirements:
|
127
85
|
- - ">="
|
128
86
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
87
|
+
version: 2.7.6b
|
130
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
89
|
requirements:
|
132
90
|
- - ">="
|
133
91
|
- !ruby/object:Gem::Version
|
134
92
|
version: '0'
|
135
93
|
requirements: []
|
136
|
-
rubygems_version: 3.4.
|
94
|
+
rubygems_version: 3.4.10
|
137
95
|
signing_key:
|
138
96
|
specification_version: 4
|
139
97
|
summary: A low level implementation of the HTTP/1 protocol.
|
metadata.gz.sig
CHANGED
Binary file
|