Feature Request: Support Http trailers in chunked transfer

未关闭
#28 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
ruby
领域
networking

调研方向

阅读 RFC 7230 的第 4.1 节,然后检查 lib/net/http/generic_request.rb,尤其是 Chunker 和 GenericRequest#send_request_with_body_stream。定义调用方如何提供 trailers,并验证 chunked 编码的 body 会在 last-chunk 和最终 CRLF 之后发出 trailer-part。

由索引模型根据 Issue 内容生成。

描述

Trailers in chunked transfer are described by rfc3230-section 4.1. Net/http does not support setting trailers nor is there a way for users to implement chunked trailers on top of net/http. The grammar is (combining section 4.1 and 4.1.2):

chunked-body   = *chunk
                      last-chunk
                      trailer-part
                      CRLF

     chunk          = chunk-size [ chunk-ext ] CRLF
                      chunk-data CRLF
     chunk-size     = 1*HEXDIG
     last-chunk     = 1*("0") [ chunk-ext ] CRLF

     chunk-data     = 1*OCTET ; a sequence of chunk-size octets
     trailer-part   = *( header-field CRLF )

When a body_stream is set and the transfer-encoding is chunked, GenericRequest#send_request_with_body_stream creates a Chunker . The Chunker correctly follows the rfc in writing out the chunks and writing the last-chunk as "0\r\n\r\n". However, there are no hooks or support for writing the trailer-part.

主要语言
Ruby
星标
148
派生
95
平均合并
10 小时 54 分钟
30 天内合并 PR
4

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ruby/net-http 的其他 Issue

查看 ruby/net-http 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。