CodeSampleX

Ejemplo

guzzlehttp/guzzle 8.0.2: Avoid RFC 3986 base_uri path stripping, json string double-encoding, getHeader array type errors, and stream EOF read traps in GuzzleHttp\Client

Muestra verificada para composer guzzlehttp/guzzle 8.0.2: Avoid RFC 3986 base_uri path stripping, json string double-encoding, getHeader array type errors…

sha256:e6562515ed9854401063a9e342efcace883b0bb7e7314a875ead4822104844c9

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
2
Claves de firma que lo compilaron
2
Entorno declarado php linux x64 php php composer

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
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

Caso

HOW
Objetivo
Avoid RFC 3986 base_uri path stripping, json string double-encoding, getHeader array type errors, and stream EOF read traps in GuzzleHttp\Client
Paquetes
Símbolos
  • GuzzleHttp\Client
  • GuzzleHttp\Client::request
  • GuzzleHttp\Exception\ClientException
  • GuzzleHttp\Psr7\Response::getHeader
  • GuzzleHttp\Psr7\Response::getHeaderLine
  • GuzzleHttp\Psr7\Stream::getContents
Entorno
php
Creado
2026-08-16T08:33:15Z

Contrato

  1. base_uri without trailing slash strips the final path segment when resolving relative path
  2. base_uri with trailing slash strips all path prefix when resolving leading-slash root-relative path
  3. base_uri with trailing slash and relative path without leading slash preserves prefix path
  4. passing a pre-encoded JSON string to json option double-encodes into a quoted JSON string literal
  5. passing an associative array to json option correctly serializes to a JSON object
  6. getHeader returns an array of string header values rather than a scalar string
  7. getHeaderLine returns the combined comma-separated string header representation
  8. getBody getContents advances stream pointer to EOF returning empty string on subsequent calls
  9. casting getBody to string rewinds seekable stream returning full payload
  10. default request throws ClientException on 4xx unless http_errors is explicitly false

Archivos

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

Descargar el artefacto de código fuente (tar.gz)

Seeder de origen

csx-seed