http-2 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +9 -0
- data/.travis.yml +6 -3
- data/lib/http/2/compressor.rb +2 -2
- data/lib/http/2/connection.rb +6 -5
- data/lib/http/2/version.rb +1 -1
- data/spec/connection_spec.rb +21 -5
- data/spec/server_spec.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5617138c0740b55546b79e29a06978a9fcb9aae208ccb2f695c32939eca5f88a
|
4
|
+
data.tar.gz: 193880583c0a80aa569f433977af1798c98be25a86fb782a410e16eb38d5116c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46fde2633ab7d074136a32e7ae8cdf90ecd037f3a95bfeabab9557d72a13487a47a3e298339bc74df4d89c6b802537b9c35a1f7709fd6cf1f4fde44eecbe468e
|
7
|
+
data.tar.gz: 6eadeb79f3bbf6fa1911933e2dc399bfe50ae08c598cb72278a37e0c42102bf27ccbed77b7acb5e7f1e85a55bd6967e63a8950fa3184fb7c9eef750c8a9e123c
|
data/.rubocop_todo.yml
CHANGED
@@ -62,6 +62,15 @@ Style/Documentation:
|
|
62
62
|
- 'example/upgrade_server.rb'
|
63
63
|
- 'lib/tasks/generate_huffman_table.rb'
|
64
64
|
|
65
|
+
# Offense count: 3
|
66
|
+
# Cop supports --auto-correct.
|
67
|
+
# Configuration parameters: EnforcedStyle.
|
68
|
+
# SupportedStyles: braces, no_braces, context_dependent
|
69
|
+
Style/BracesAroundHashParameters:
|
70
|
+
Exclude:
|
71
|
+
- 'spec/connection_spec.rb'
|
72
|
+
- 'spec/server_spec.rb'
|
73
|
+
|
65
74
|
# Offense count: 1
|
66
75
|
# Cop supports --auto-correct.
|
67
76
|
Style/EmptyCaseCondition:
|
data/.travis.yml
CHANGED
data/lib/http/2/compressor.rb
CHANGED
@@ -331,7 +331,7 @@ module HTTP2
|
|
331
331
|
class Compressor
|
332
332
|
# @param options [Hash] encoding options
|
333
333
|
def initialize(**options)
|
334
|
-
@cc = EncodingContext.new(options)
|
334
|
+
@cc = EncodingContext.new(**options)
|
335
335
|
end
|
336
336
|
|
337
337
|
# Set dynamic table size in EncodingContext
|
@@ -470,7 +470,7 @@ module HTTP2
|
|
470
470
|
class Decompressor
|
471
471
|
# @param options [Hash] decoding options. Only :table_size is effective.
|
472
472
|
def initialize(**options)
|
473
|
-
@cc = EncodingContext.new(options)
|
473
|
+
@cc = EncodingContext.new(**options)
|
474
474
|
end
|
475
475
|
|
476
476
|
# Set dynamic table size in EncodingContext
|
data/lib/http/2/connection.rb
CHANGED
@@ -76,8 +76,8 @@ module HTTP2
|
|
76
76
|
@local_settings = DEFAULT_CONNECTION_SETTINGS.merge(settings)
|
77
77
|
@remote_settings = SPEC_DEFAULT_CONNECTION_SETTINGS.dup
|
78
78
|
|
79
|
-
@compressor = Header::Compressor.new(settings)
|
80
|
-
@decompressor = Header::Decompressor.new(settings)
|
79
|
+
@compressor = Header::Compressor.new(**settings)
|
80
|
+
@decompressor = Header::Decompressor.new(**settings)
|
81
81
|
|
82
82
|
@active_stream_count = 0
|
83
83
|
@streams = {}
|
@@ -539,7 +539,7 @@ module HTTP2
|
|
539
539
|
# Process pending settings we have sent.
|
540
540
|
[@pending_settings.shift, :local]
|
541
541
|
else
|
542
|
-
connection_error
|
542
|
+
connection_error if validate_settings(@remote_role, frame[:payload])
|
543
543
|
[frame[:payload], :remote]
|
544
544
|
end
|
545
545
|
|
@@ -593,7 +593,8 @@ module HTTP2
|
|
593
593
|
# nothing to do
|
594
594
|
|
595
595
|
when :settings_max_frame_size
|
596
|
-
#
|
596
|
+
# update framer max_frame_size
|
597
|
+
@framer.max_frame_size = v
|
597
598
|
|
598
599
|
# else # ignore unknown settings
|
599
600
|
end
|
@@ -674,7 +675,7 @@ module HTTP2
|
|
674
675
|
def activate_stream(id: nil, **args)
|
675
676
|
connection_error(msg: 'Stream ID already exists') if @streams.key?(id)
|
676
677
|
|
677
|
-
stream = Stream.new({ connection: self, id: id }.merge(args))
|
678
|
+
stream = Stream.new(**{ connection: self, id: id }.merge(args))
|
678
679
|
|
679
680
|
# Streams that are in the "open" state, or either of the "half closed"
|
680
681
|
# states count toward the maximum number of streams that an endpoint is
|
data/lib/http/2/version.rb
CHANGED
data/spec/connection_spec.rb
CHANGED
@@ -50,6 +50,22 @@ RSpec.describe HTTP2::Connection do
|
|
50
50
|
expect(@conn.remote_settings[:settings_header_table_size]).to eq 256
|
51
51
|
end
|
52
52
|
|
53
|
+
it 'should reflect settings_max_frame_size recevied from peer' do
|
54
|
+
settings = settings_frame
|
55
|
+
settings[:payload] = [[:settings_max_frame_size, 16_385]]
|
56
|
+
|
57
|
+
@conn << f.generate(settings)
|
58
|
+
|
59
|
+
frame = {
|
60
|
+
length: 16_385,
|
61
|
+
type: :data,
|
62
|
+
flags: [:end_stream],
|
63
|
+
stream: 1,
|
64
|
+
payload: 'a' * 16_385,
|
65
|
+
}
|
66
|
+
expect { @conn.send(frame) }.not_to raise_error(CompressionError)
|
67
|
+
end
|
68
|
+
|
53
69
|
it 'should send SETTINGS ACK when SETTINGS is received' do
|
54
70
|
settings = settings_frame
|
55
71
|
settings[:payload] = [[:settings_header_table_size, 256]]
|
@@ -369,7 +385,7 @@ RSpec.describe HTTP2::Connection do
|
|
369
385
|
stream = @conn.new_stream
|
370
386
|
|
371
387
|
expect do
|
372
|
-
stream.headers('name' => Float::INFINITY)
|
388
|
+
stream.headers({ 'name' => Float::INFINITY })
|
373
389
|
end.to raise_error(CompressionError)
|
374
390
|
end
|
375
391
|
|
@@ -397,10 +413,10 @@ RSpec.describe HTTP2::Connection do
|
|
397
413
|
end
|
398
414
|
|
399
415
|
stream = @conn.new_stream
|
400
|
-
stream.headers(':method' => 'get',
|
401
|
-
|
402
|
-
|
403
|
-
|
416
|
+
stream.headers({ ':method' => 'get',
|
417
|
+
':scheme' => 'http',
|
418
|
+
':authority' => 'www.example.org',
|
419
|
+
':path' => '/resource' })
|
404
420
|
end
|
405
421
|
|
406
422
|
it 'should generate CONTINUATION if HEADERS is too long' do
|
data/spec/server_spec.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Grigorik
|
8
8
|
- Kaoru Maeda
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -90,7 +90,7 @@ homepage: https://github.com/igrigorik/http-2
|
|
90
90
|
licenses:
|
91
91
|
- MIT
|
92
92
|
metadata: {}
|
93
|
-
post_install_message:
|
93
|
+
post_install_message:
|
94
94
|
rdoc_options: []
|
95
95
|
require_paths:
|
96
96
|
- lib
|
@@ -105,8 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
|
-
rubygems_version: 3.
|
109
|
-
signing_key:
|
108
|
+
rubygems_version: 3.0.3
|
109
|
+
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Pure-ruby HTTP 2.0 protocol implementation
|
112
112
|
test_files:
|