lib/httpx/plugins/upgrade/h2.rb in httpx-0.22.5 vs lib/httpx/plugins/upgrade/h2.rb in httpx-0.23.0
- old
+ new
@@ -8,12 +8,12 @@
#
# https://gitlab.com/honeyryderchuck/httpx/wikis/Upgrade#h2
#
module H2
class << self
- def configure(klass)
- klass.default_options.upgrade_handlers.register "h2", self
+ def extra_options(options)
+ options.merge(upgrade_handlers: options.upgrade_handlers.merge("h2" => self))
end
def call(connection, _request, _response)
connection.upgrade_to_h2
end
@@ -30,10 +30,10 @@
@inflight -= prev_parser.requests.size
end
@parser = Connection::HTTP2.new(@write_buffer, @options)
set_parser_callbacks(@parser)
- @upgrade_protocol = :h2
+ @upgrade_protocol = "h2"
# what's happening here:
# a deviation from the state machine is done to perform the actions when a
# connection is closed, without transitioning, so the connection is kept in the pool.
# the state is reset to initial, so that the socket reconnect works out of the box,