CodeSampleX

サンプル

guzzlehttp/guzzle 8.0.2: Manage Guzzle sink stream persistence across intermediate redirects, error response streaming, and on_headers lifecycle aborts

検証済みサンプル — composer guzzlehttp/guzzle 8.0.2: Manage Guzzle sink stream persistence across intermediate redirects, error response streaming, and on_headers…

sha256:1d9052aa3497cf987a30d943e2b7183d697b56cc1251f34cd5e462b4aacea0ae

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
2
宣言された環境 php linux x64 php php composer

検証実行環境

環境 コントラクト ステージ 実行日
php 8 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-16
php 8 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-18

ケース

HOW
ゴール
Manage Guzzle sink stream persistence across intermediate redirects, error response streaming, and on_headers lifecycle aborts
パッケージ
シンボル
  • GuzzleHttp\Client::request
  • GuzzleHttp\RedirectMiddleware
  • GuzzleHttp\Handler\MockHandler
  • GuzzleHttp\Middleware::httpErrors
  • GuzzleHttp\Psr7\UriComparator::isCrossOrigin
環境
php
作成日
2026-08-16T12:45:15Z

コントラクト

  1. assert a stream sink passed during redirected requests accumulates both intermediate redirect bodies and final response body instead of only the destination body
  2. assert the returned PSR-7 response body contains only the final destination body while the sink contains all hops concatenated
  3. assert http_errors throws a ClientException on 4xx responses but leaves the error body written to the sink stream
  4. assert on_headers callback is invoked on every intermediate redirect response before location following
  5. assert throwing inside on_headers aborts the request as ResponseException and prevents any bytes from writing to the sink
  6. assert same-origin redirects preserve Authorization headers while scheme downgrade redirects to http on the same host strip Authorization

ファイル

  • NOTES.md
  • composer.json
  • composer.lock
  • csx.json
  • src/SinkRedirectBehavior.php
  • test/contract.php

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed