protocol-http1 0.27.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/http1/connection.rb +13 -2
- data/lib/protocol/http1/error.rb +3 -0
- data/lib/protocol/http1/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: 418429eead441a575d5129d78ec4eaa2806e354219b44f8be723ba263ed6dff4
|
4
|
+
data.tar.gz: 2306e29dfe8ecf2344fc0b3672be0b4bbab681139e81b3b7f710821aba858ee2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f30451ee6eb024628fd4edb09b688206b4fb956080b11bd83ca1c243eb66a50473e03b710ff19cd1a94e1c34a3197bd3b584566694b5a3d9171c5d4b3de773f0
|
7
|
+
data.tar.gz: b89b24a8163a31f91d801472d3fc44f207dd909ad66c9caeffbd737c674e8905cdc93ac328db2aeca049896011ad093532e87fa608fe01672c645e55b6689f34
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -45,18 +45,22 @@ module Protocol
|
|
45
45
|
VALID_FIELD_NAME = /\A#{FIELD_NAME}\z/.freeze
|
46
46
|
VALID_FIELD_VALUE = /\A#{FIELD_VALUE}\z/.freeze
|
47
47
|
|
48
|
+
DEFAULT_MAXIMUM_LINE_LENGTH = 8192
|
49
|
+
|
48
50
|
class Connection
|
49
51
|
CRLF = "\r\n"
|
50
52
|
HTTP10 = "HTTP/1.0"
|
51
53
|
HTTP11 = "HTTP/1.1"
|
52
54
|
|
53
|
-
def initialize(stream, persistent: true, state: :idle)
|
55
|
+
def initialize(stream, persistent: true, state: :idle, maximum_line_length: DEFAULT_MAXIMUM_LINE_LENGTH)
|
54
56
|
@stream = stream
|
55
57
|
|
56
58
|
@persistent = persistent
|
57
59
|
@state = state
|
58
60
|
|
59
61
|
@count = 0
|
62
|
+
|
63
|
+
@maximum_line_length = maximum_line_length
|
60
64
|
end
|
61
65
|
|
62
66
|
attr :stream
|
@@ -282,7 +286,14 @@ module Protocol
|
|
282
286
|
end
|
283
287
|
|
284
288
|
def read_line?
|
285
|
-
@stream.gets(CRLF,
|
289
|
+
if line = @stream.gets(CRLF, @maximum_line_length)
|
290
|
+
unless line.chomp!(CRLF)
|
291
|
+
# This basically means that the request line, response line, header, or chunked length line is too long.
|
292
|
+
raise LineLengthError, "Line too long!"
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
return line
|
286
297
|
end
|
287
298
|
|
288
299
|
def read_line
|
data/lib/protocol/http1/error.rb
CHANGED
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.
|
4
|
+
version: 0.28.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -42,7 +42,7 @@ cert_chain:
|
|
42
42
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
43
43
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
44
44
|
-----END CERTIFICATE-----
|
45
|
-
date: 2024-
|
45
|
+
date: 2024-10-15 00:00:00.000000000 Z
|
46
46
|
dependencies:
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: protocol-http
|
metadata.gz.sig
CHANGED
Binary file
|