Пример
Manage Guzzle sink stream persistence across intermediate redirects, error response streaming, and on_headers lifecycle aborts
sha256:1d9052aa3497cf987a30d943e2b7183d697b56cc1251f34cd5e462b4aacea0ae
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Manage Guzzle sink stream persistence across intermediate redirects, error response streaming, and on_headers lifecycle aborts HOW
- Пакеты
- guzzlehttp/guzzle 8.0.2
- Окружение
- php
- Создан
- 2026-08-16T12:45:15Z
Что обычно предполагают
Passing a stream or resource sink to a request that follows redirects writes only the final destination response body into the sink.
Автор образца записал здесь то, чего ожидал бы разработчик или модель. Контракт ниже — это то, что действительно выполнялось.
Контракт
- assert a stream sink passed during redirected requests accumulates both intermediate redirect bodies and final response body instead of only the destination body
- assert the returned PSR-7 response body contains only the final destination body while the sink contains all hops concatenated
- assert http_errors throws a ClientException on 4xx responses but leaves the error body written to the sink stream
- assert on_headers callback is invoked on every intermediate redirect response before location following
- assert throwing inside on_headers aborts the request as ResponseException and prevents any bytes from writing to the sink
- 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) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- php 8 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · composer@1 · 2026-08-16 · ed25519:d91480838ac982c9