http-2-next 0.2.0 → 0.2.1

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: 875825ebea128127df77ca3dda0f1a541b1a04329fd210c1e833e188b61fb6fd
4
- data.tar.gz: 257aa0e0296ecb15eeb819aa828d0b80f09e88890c7888f886741bf84da58c81
3
+ metadata.gz: 1eaeeaa49a752ff95b0cf220cf08a725f471d7b13015e78fb20c5cb2dd73118d
4
+ data.tar.gz: 67f3a2ff286dd2916f849e60ced05aeff39842feb75f2c2088fc29c177459a92
5
5
  SHA512:
6
- metadata.gz: 56d023be9199b34436061f3f24c47a2a79914d86dbcf45535ae46983a905c6cf84160263a5576ad79e59319ba2470d1c0e6e5e55eb4e8f90a7a46b0d2530a2fb
7
- data.tar.gz: db01e4e809a622908eacdb55f4c9b739f34afa8cb825aa63be9ef3b2aadb4c1e8d02ee2a5459d5492abc27df82108be5fd60e66ba77402a836aa12a7be64c7e7
6
+ metadata.gz: dfcedbd08e28236d673354ed49e2c9bbbd09fa6953775c6a943e9707675fab6eb82133096eb048fffc050f9acf666952b3fb9619c68314e663ac00af2f126c3a
7
+ data.tar.gz: f87a894094ff8d39dea28fb966e81bcf04dfa4d8cfb4bcf067c103f2dc1a09c82a6a6a0af87558a40cd16ca7f8e5157f9b4fed48cc100bb3578913e210f5ff00
@@ -20,7 +20,7 @@ module HTTP2Next
20
20
  #
21
21
  class Client < Connection
22
22
  # Initialize new HTTP 2.0 client object.
23
- def initialize(**settings)
23
+ def initialize(settings = {})
24
24
  @stream_id = 1
25
25
  @state = :waiting_connection_preface
26
26
 
@@ -67,7 +67,7 @@ module HTTP2Next
67
67
  settings(payload)
68
68
  end
69
69
 
70
- def self.settings_header(**settings)
70
+ def self.settings_header(settings)
71
71
  frame = Framer.new.generate(type: :settings, stream: 0, payload: settings)
72
72
  Base64.urlsafe_encode64(frame[9..-1])
73
73
  end
@@ -96,7 +96,7 @@ module HTTP2Next
96
96
  # :table_size Integer maximum dynamic table size in bytes
97
97
  # :huffman Symbol :always, :never, :shorter
98
98
  # :index Symbol :all, :static, :never
99
- def initialize(**options)
99
+ def initialize(options = {})
100
100
  default_options = {
101
101
  huffman: :shorter,
102
102
  index: :all,
@@ -349,7 +349,7 @@ module HTTP2Next
349
349
  # Responsible for encoding header key-value pairs using HPACK algorithm.
350
350
  class Compressor
351
351
  # @param options [Hash] encoding options
352
- def initialize(**options)
352
+ def initialize(options = {})
353
353
  @cc = EncodingContext.new(options)
354
354
  end
355
355
 
@@ -414,9 +414,7 @@ module HTTP2Next
414
414
  def string(str)
415
415
  plain = nil
416
416
  huffman = nil
417
- unless @cc.options[:huffman] == :always
418
- plain = integer(str.bytesize, 7) << str.dup.force_encoding(Encoding::BINARY)
419
- end
417
+ plain = integer(str.bytesize, 7) << str.dup.force_encoding(Encoding::BINARY) unless @cc.options[:huffman] == :always
420
418
  unless @cc.options[:huffman] == :never
421
419
  huffman = Huffman.new.encode(str)
422
420
  huffman = integer(huffman.bytesize, 7) << huffman
@@ -491,7 +489,7 @@ module HTTP2Next
491
489
  include Error
492
490
 
493
491
  # @param options [Hash] decoding options. Only :table_size is effective.
494
- def initialize(**options)
492
+ def initialize(options = {})
495
493
  @cc = EncodingContext.new(options)
496
494
  end
497
495
 
@@ -74,7 +74,7 @@ module HTTP2Next
74
74
 
75
75
  # Initializes new connection object.
76
76
  #
77
- def initialize(**settings)
77
+ def initialize(settings = {})
78
78
  @local_settings = DEFAULT_CONNECTION_SETTINGS.merge(settings)
79
79
  @remote_settings = SPEC_DEFAULT_CONNECTION_SETTINGS.dup
80
80
 
@@ -240,9 +240,7 @@ module HTTP2Next
240
240
  length += 4 + frame[:payload].bytesize
241
241
 
242
242
  when :ping
243
- if frame[:payload].bytesize != 8
244
- raise CompressionError, "Invalid payload size (#{frame[:payload].size} != 8 bytes)"
245
- end
243
+ raise CompressionError, "Invalid payload size (#{frame[:payload].size} != 8 bytes)" if frame[:payload].bytesize != 8
246
244
 
247
245
  bytes << frame[:payload]
248
246
  length += 8
@@ -25,7 +25,7 @@ module HTTP2Next
25
25
  attr_reader :origin_set
26
26
 
27
27
  # Initialize new HTTP 2.0 server object.
28
- def initialize(**settings)
28
+ def initialize(settings = {})
29
29
  @stream_id = 2
30
30
  @state = :waiting_magic
31
31
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTP2Next
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http-2-next
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-12-14 00:00:00.000000000 Z
13
+ date: 2019-12-30 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Pure-ruby HTTP 2.0 protocol implementation
16
16
  email:
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  requirements: []
57
- rubygems_version: 3.0.6
57
+ rubygems_version: 3.1.2
58
58
  signing_key:
59
59
  specification_version: 4
60
60
  summary: Pure-ruby HTTP 2.0 protocol implementation