http-2 icon indicating copy to clipboard operation
http-2 copied to clipboard

Decompressor comment incorrect

Open sshock opened this issue 5 years ago • 2 comments
trafficstars

In the HTTP2::Header::Decompressor class it has this comment:

    # Responsible for decoding received headers and maintaining compression
    # context of the opposing peer. Decompressor must be initialized with
    # appropriate starting context based on local role: client or server.
    #
    # @example
    #   server_role = Decompressor.new(:request)
    #   client_role = Decompressor.new(:response)

Yet the constructor does not take any normal arguments, just an options hash:

      def initialize(**options)
        @cc = EncodingContext.new(options)
      end

So if you try to initialize it as described, you'll get a wrong number of arguments error.

sshock avatar Aug 07 '20 20:08 sshock

Good catch, ty for reporting it! Is this a documentation bug only, or does it affect some functionality you're looking to wire up?

igrigorik avatar Aug 07 '20 21:08 igrigorik

As far as I know it's just a documentation bug. I've been able to decode header frames no problem, both on the client and on the server side.

sshock avatar Aug 08 '20 00:08 sshock