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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dd78ba6a3468b6a3ceda2ebabc37ceb895a90d675d9fecc035b74d2f479a457
4
- data.tar.gz: d70542d69e57050ab9ee3c837b6123fea81424a03bf3b99ffdc889a54a2fd20c
3
+ metadata.gz: 5617138c0740b55546b79e29a06978a9fcb9aae208ccb2f695c32939eca5f88a
4
+ data.tar.gz: 193880583c0a80aa569f433977af1798c98be25a86fb782a410e16eb38d5116c
5
5
  SHA512:
6
- metadata.gz: f678316f6235ed93ce5a3902ef3bf4c48854605de0875054d1f3e05196fc161bdfe49d149ff930413bef5ca76c61ab2d193092867a383f1f5dbe309cfef0f012
7
- data.tar.gz: 52fce71379a9299df1cd8c93d44964d668d09c199564482193513b109a6339f220b4ae1e724c5965892b3e53855820a810e95405b8eb198797ea130611d39a05
6
+ metadata.gz: 46fde2633ab7d074136a32e7ae8cdf90ecd037f3a95bfeabab9557d72a13487a47a3e298339bc74df4d89c6b802537b9c35a1f7709fd6cf1f4fde44eecbe468e
7
+ data.tar.gz: 6eadeb79f3bbf6fa1911933e2dc399bfe50ae08c598cb72278a37e0c42102bf27ccbed77b7acb5e7f1e85a55bd6967e63a8950fa3184fb7c9eef750c8a9e123c
@@ -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:
@@ -1,10 +1,13 @@
1
- sudo: false
2
1
  language: ruby
2
+ cache: bundler
3
3
  rvm:
4
4
  - 2.1
5
5
  - 2.2
6
- - 2.3.0
7
- - 2.4.0
6
+ - 2.3
7
+ - 2.4
8
+ - 2.5
9
+ - 2.6
10
+ - 2.7
8
11
  - jruby-9.2.0.0 # latest stable
9
12
  - jruby-head
10
13
  - rbx-2
@@ -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
@@ -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(check) if validate_settings(@remote_role, frame[:payload])
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
- # nothing to do
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
@@ -1,3 +1,3 @@
1
1
  module HTTP2
2
- VERSION = '0.10.2'.freeze
2
+ VERSION = '0.11.0'.freeze
3
3
  end
@@ -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
- ':scheme' => 'http',
402
- ':authority' => 'www.example.org',
403
- ':path' => '/resource')
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
@@ -42,7 +42,7 @@ RSpec.describe HTTP2::Server do
42
42
 
43
43
  @srv.on(:stream) do |stream|
44
44
  expect do
45
- stream.promise(':method' => 'GET') {}
45
+ stream.promise({ ':method' => 'GET' }) {}
46
46
  end.to_not raise_error
47
47
  end
48
48
 
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.10.2
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: 2020-06-14 00:00:00.000000000 Z
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.1.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: