CodeSampleX

Sample

Enforce allowed Content-Type headers using chi middleware.AllowContentType without bypassing empty POST requests or rejecting GET requests with payloads

sha256:037510e85f8dba770d16f88ad5b0518221d158d0c8dd7458642d69b91926d5e1

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Enforce allowed Content-Type headers using chi middleware.AllowContentType without bypassing empty POST requests or rejecting GET requests with payloads HOW
Packages
github.com/go-chi/chi/v5 v5.2.1
Environment
go
Created
2026-08-17T01:26:39Z

Commonly assumed

middleware.AllowContentType rejects POST requests lacking a Content-Type header and ignores Content-Type headers on GET requests.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts