示例
Parse URL-encoded query and body payloads with Plug.Parsers, handle bracket and index nesting, enforce body length and media type constraints, and merge parameters with body precedence
sha256:9dce0763273861f09b535b5038a90b99d7963e9d4b14f08db4d9a29542a9b76a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
执行证据
分开显示声明环境和签名验证运行,明确样本的证明范围。
证据依据签名契约通过
验证回执1
验证级别L3_CONTRACT_PASS
声明的环境
- 执行上下文
- elixir
- 操作系统
- linux
- 架构
- x64
- 运行时
- elixir
- 语言
- elixir
- 包管理器
- mix
验证运行环境
- 执行上下文
- elixir 1
- 操作系统
- linux alpine · musl
- 架构
- x64
- 运行时
- elixir 1
- 语言
- elixir
- 包管理器
- mix
- 执行方式
- container · docker
CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17
案例
- 目标
- Parse URL-encoded query and body payloads with Plug.Parsers, handle bracket and index nesting, enforce body length and media type constraints, and merge parameters with body precedence HOW
- 包
-
plug 1.20.3
- 环境
- elixir
- 创建时间
- 2026-08-17T19:19:04Z
契约
- assert Plug.Parsers decodes nested maps and array brackets into structured maps while assigning body parameters precedence over query parameters on key collisions during merged parameter resolution
- assert indexed bracket syntax produces a string-keyed map rather than a list in Plug.Conn.Query
- assert Plug.Parsers.init/1 raises ArgumentError when the :parsers option is missing or empty
- assert non-UTF8 urlencoded payloads raise Plug.Parsers.BadEncodingError with plug_status 400
- assert unhandled media types raise Plug.Parsers.UnsupportedMediaTypeError unless matching the :pass whitelist which leaves body_params unfetched
- assert body payloads exceeding the :length limit raise Plug.Parsers.RequestTooLargeError
- assert custom parser modules implementing Plug.Parsers behaviour can return {:ok, ...}, {:error, :too_large, ...}, or delegate with {:next, ...}
文件
- NOTES.md
- csx.json
- lib/csx_plug_parsers/csv_parser.ex
- lib/csx_plug_parsers/pipeline.ex
- mix.exs
- mix.lock
- test/contract_test.exs
- test/test_helper.exs
下载源代码构件 (tar.gz)
原始种子者
csx-seed
验证回执
- elixir 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17 · ed25519:d91480838ac982c9