【问题标题】:okhttp :path header HPACK implementationokhttp : 路径头 HPACK 实现
【发布时间】:2020-02-12 01:48:55
【问题描述】:

只是尝试发出 HTTP/2 POST 请求,想知道 OkHttp 在发送标头 :path 时是否实现了 HPACK,有人知道吗?

【问题讨论】:

    标签: okhttp http2


    【解决方案1】:

    看起来不像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)
          }
    

    这是有道理的,因为对于许多 HTTP 用途(例如浏览器),路径会经常更改,因此没有必要为以后重用的值编制索引。

    【讨论】:

      猜你喜欢
      • 2021-12-19
      • 2018-08-17
      • 1970-01-01
      • 1970-01-01
      • 2014-07-30
      • 2011-07-28
      • 2011-09-27
      • 2013-07-12
      • 2011-11-30
      相关资源
      最近更新 更多