Guti
Guti

Reputation: 57

okhttp :path header HPACK implementation

Just trying to make an HTTP/2 POST request and wondering if OkHttp implements HPACK when sending the header :path, does anyone know?

Upvotes: 1

Views: 163

Answers (1)

Barry Pollard
Barry Pollard

Reputation: 46040

Does not look like it does from a quick search of the code:

      name.startsWith(Header.PSEUDO_PREFIX) && TARGET_AUTHORITY != name -> {
        // Follow Chromes lead - only include the :authority pseudo header, but exclude all other
        // pseudo headers. Literal Header Field without Indexing - Indexed Name.
        writeInt(headerNameIndex, PREFIX_4_BITS, 0)
        writeByteString(value)
      }

This makes sense as for many HTTP uses (e.g. browsers) the path will change frequently so no point indexing the value for later reuse.

Upvotes: 1

Related Questions