CodeSampleX

サンプル

Prove that ResponseWriter header modifications made after WriteHeader are silently dropped from the response.

sha256:ec9a568e5b97777537dd0d9c4a63cfcd68a69c8b638fa0433da2221557702f8c

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Prove that ResponseWriter header modifications made after WriteHeader are silently dropped from the response. HOW
パッケージ
net/http go1.26.5
環境
go
作成日
2026-08-17T01:33:16Z

よくある思い込み

Headers set on http.ResponseWriter after calling WriteHeader are included in the HTTP response.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート