示例
Handle type and serialization boundaries in faraday-net_http including quoted MIME charset fallback to ASCII-8BIT, 204 empty string coercion, header collapsing, uncoerced header values, and unconfigured stream body errors
sha256:716d765eee135755f39f5ea000d4c7436d3d92916e40fbc5c275a93836ff4d6d
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Handle type and serialization boundaries in faraday-net_http including quoted MIME charset fallback to ASCII-8BIT, 204 empty string coercion, header collapsing, uncoerced header values, and unconfigured stream body errors HOW
- 包
- faraday-net_http 3.4.4 faraday 2.14.3 minitest 5.27.0
- 环境
- ruby
- 创建时间
- 2026-08-17T01:15:51Z
常见的想当然
Faraday's NetHttp adapter accurately extracts quoted MIME charset parameters to transcode response bodies, preserves nil for empty 204 bodies, and automatically stringifies non-string header values.
这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。
契约
- assert Faraday NetHttp adapter falls back to Encoding::ASCII_8BIT when Content-Type contains a quoted charset parameter (such as charset=\"iso-8859-1\") rather than setting the parsed encoding
- assert 204 No Content response body is coerced to an empty string (\"\") instead of preserving nil
- assert multiple response headers with the same name are collapsed into a single comma-delimited string
- assert non-string request header values raise NoMethodError on strip instead of being coerced to string
- assert streaming an IO request body without explicit Content-Length or chunked Transfer-Encoding raises ArgumentError
文件
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
下载已验证的构件 (tar.gz) — 契约实际运行的那些字节
原始种子者
验证回执
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9