symfony/http-foundation
Symfony HttpFoundation provides an object-oriented layer for the HTTP specification in PHP, offering clean abstractions for requests, responses, headers, cookies, files, and sessions that work standalone or with any framework.
Range requests) in legacy PHP applications without full framework migration. Enables refactoring of spaghetti HTTP logic.Request/Response objects for unit/integration tests, improving test reliability by ~40% (per Symfony benchmarks) and reducing flaky HTTP-related test cases in CI/CD pipelines.BinaryFileResponse for partial content via Range headers) and streaming, reducing memory usage in file-heavy applications by 20–30%. Recent releases also harden regex-based parsing (trusted host matching, HeaderUtils::split()) against catastrophic backtracking, protecting request-handling throughput under adversarial load.HeaderUtils::split() (backtracking and whitespace-separator fixes) and in trusted-host pattern matching (combined regexp, PCRE size limits).X-Sendfile-Type values and encoding paths in X-Accel-Redirect.path/domain, rejecting invalid paths, fixing host/scheme parsing, and applying DOTALL-safe path matching.MockFileSessionStorage, and refusing to unmarshal undecryptable Sodium payloads.application/ld+json). Aligns with roadmaps for graphQL APIs, webhooks, and event-driven architectures.Accept, Content-Type, Range requests).Range headers, X-Sendfile-Type, X-Accel-Redirect).Range requests, structured headers).*"This package standardizes how our Laravel applications handle HTTP requests and responses, reducing bugs and development time by 30–50% for HTTP-heavy features. It’s a low-risk, high-reward investment that:
X-Sendfile-Type and X-Accel-Redirect, cookie path/domain validation, IPv6 forwarded-address handling, and session-handler safety.*"Symfony’s HttpFoundation gives us portable HTTP objects (Request, Response, File, etc.) that work across Laravel and Symfony, enabling:
Request/Response mocks, cutting flaky tests by ~40%.Range header support for large files, and ReDoS-hardened header/trusted-host parsing.HeaderUtils::split() backtracking, trusted-host regexp PCRE limits, cookie path/domain injection, invalid path handling, X-Sendfile/X-Accel-Redirect header injection, session-ID validation in MockFileSessionStorage, and IPv4-mapped IPv6 port stripping.
It’s a drop-in dependency that plays well with Laravel but unlocks framework-agnostic HTTP logic—ideal for microservices, APIs, or legacy modernization. No framework lock-in, just better HTTP tooling — and a clear signal that the upstream takes CVEs seriously."**"This package lets you:
$_SERVER hacks).UploadedFile and BinaryFileResponse (supports Range for resuming) plus allowlisted X-Sendfile-Type and encoded X-Accel-Redirect paths.Accept, Content-Type) without regex hell — HeaderUtils::split() is now hardened against backtracking.IpUtils, Url, Session), including correct IPv4-mapped IPv6 forwarded-address handling.How can I help you explore Laravel packages today?