nette/http
🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.
v3.4.0
20M downloads/mo
#1806 most downloaded on Packagist
nette/http
What this package is like to depend on
Last release 2 months ago
13 Jun 2026
Ships fairly regularly
a new release about every 4 months
Rarely documented
notes for 10 of 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
60 releases · first in 2014
3 releases in the last 12 months
see the full history below
Release timeline
60 releases · Jun 2014 to Jun 2026Releases
latest 60-
v3.4.013 Jun 2026Release notes
Open source →This release brings serious firepower to server-side HTTP handling. The headline is a brand-new SSRF defense kit –
IPAddressandUrlValidatorlet you validate URLs and pin connections before your app ever talks to an attacker-controlled host. On top of that, cookie handling gets a modern overhaul with a type-safeSameSiteenum, CHIPS/Partitionedsupport, and a properMax-Ageattribute, while the newRequest::isFrom()gives you reliable same-site request detection – even on Safari. Now on PHP 8.3.Changes
- PHP 8.3 is now required. Time to upgrade your runtime if you haven't already.
UserStorageis gone – the long-deprecated class has been removed. Use the standard authentication storage instead.Request::getRemoteHost()is deprecated and now returnsnull– reverse DNS lookups were slow, unreliable, and a privacy footgun. Resolve the hostname yourself fromgetRemoteAddress()if you really need it (#218).
Deprecations (still working, but plan ahead)
- The
IResponse::SameSite*constants are deprecated in favor of the newSameSiteenum. Request::isSameSite()is deprecated – useisFrom()instead.- Passing integer
0as the expiration toResponse::setCookie()is deprecated – usenullfor a session cookie.
✨ New Features
- SSRF protection, batteries included – the new IPAddress is an immutable IPv4/IPv6 value object with rich predicates (
isPublic(),isPrivate(),isLoopback(),isLinkLocal(),isMulticast(),isReserved()), CIDR matching viaisInRange(), and IPv4-mapped IPv6 normalization. Pair it with UrlValidator, a configurable guard that vets scheme, port, host allow/blocklists, userinfo, and – optionally with DNS – the resolved IP ranges. It even hands back the resolved IPs so you can pin the connection throughCURLOPT_RESOLVEand defeat DNS-rebinding. Request::isFrom()– a single, reliable way to check where a request came from, withsite,dest, anduserparameters built on theSec-Fetch-*headers. For browsers withoutSec-Fetchsupport (Safari < 16.4), it transparently falls back to a strict cookie, so same-site detection just works everywhere.- Type-safe
SameSiteenum –setCookie()andSessionnow accept a proper enum instead of magic strings, so typos become compile-time problems, not silent security holes. Response::setCookie()speaks modern cookie – it now supports thePartitionedattribute (CHIPS) for third-party cookies, emits aMax-Ageattribute (which takes precedence overexpiresand ignores the client clock), and forcesSecureautomatically whenSameSite=None, sparing you a browser rejection.Helpers::expirationToSeconds()– one consistent parser for every expiration value across the library. Numbers are relative seconds, whileDateTimeInterfaceand textual strings like'20 minutes'or'2024-01-01'resolve as absolute times; each caller decides whatnullmeans in its own context.Helpers::parseQualityList()– parses HTTP quality-value lists (Accept,Accept-Language, …) into a ranked token map.Request::detectLanguage()was rewritten on top of it and is more correct as a result.
-
v3.3.426 May 2026Release notes
Open source →- RequestFactory::setForceHttps() – force the request scheme to HTTPS regardless of the server environment, handy behind proxies and load balancers that don't advertise TLS termination. Also exposed via the DI config option
http: forceHttps: true. - Request::getOrigin() now strictly follows RFC 6454 – returns
nullfor anyOriginheader that isn't a barescheme://host[:port](e.g. headers containing a path are rejected instead of being silently accepted). - Improved phpDoc types and descriptions across the whole
Nette\Httpnamespace – better IDE autocompletion and PHPStan inference forRequest,Response,Session,Urland friends.
- RequestFactory::setForceHttps() – force the request scheme to HTTPS regardless of the server environment, handy behind proxies and load balancers that don't advertise TLS termination. Also exposed via the DI config option
-
v3.3.330 Oct 2025Release notes
Open source →- support for PHP 8.5
- optimized global function calls
- Url, UrlImmutable: user & password are deprecated
-
v3.3.212 Jan 2025Release notes
Open source →- UrlImmutable, UrlScript: added
resolve() - Url: added
isAbsolute()&removeDotSegments() - UrlImmutable, UrlScript: removed
build()method Url::canonicalize()char " does not need to be encoded- Url, UrlImmutable: user & password are deprecated
FileUpload::__construct()accepts path- SessionPanel: convert templates to Latte-like syntax
- UrlImmutable, UrlScript: added
-
v3.3.104 Nov 2024Release notes
Open source →- support for PHP 8.4
FileUpload::getSanitizedName()changes the extension only for image files #239- RequestFactory: extract port from x-forwarded-host (#230)
- FileUpload: Initialize properties (#235)(#195)
- Session: keep exceptions chain on session_start (#240)
- Session: SessionSection class template annotation #225
- IResponse: added DateTimeInterface to setCookie $expire param (#237)
- readonly properties
-
v3.3.030 Jan 2024 -
v3.2.430 Jan 2024Release notes
Open source →- FileUpload: added
getSuggestedExtension() - RequestFactory: unify and fix host parsing (#229)
- FileUpload: added
-
v3.2.302 Nov 2023Release notes
Open source →- support for PHP 8.3
- FileUpload: detects supported images
- RequestFactory: fixed port detection when HTTP_HOST & SERVER_PORT are used #223
- removed fix for IE
-
v3.2.218 Mar 2023Release notes
Open source →- SessionExtension: don't set readAndClose if null (#213)
- Improved https recognition behind load balancer (#221)
- RequestFactory: fix X-Forwarded-Host mixup with remote host (#222)
- RequestFactory: performance optimization #220
- RequestFactory: fixed filter detection
- Url: host can end with dot #198
- added
Session::getSectionNames(), replacement forgetIterator()
-
v3.2.105 Dec 2022Nothing published for this version
-
v3.1.818 Mar 2023 -
v3.1.713 Oct 2022Nothing published for this version
-
v3.1.602 Apr 2022Nothing published for this version
-
v3.1.529 Nov 2021Nothing published for this version
-
v3.1.225 Aug 2021Nothing published for this version
-
v3.1.125 Jan 2021Nothing published for this version
-
v3.1.004 Jan 2021Nothing published for this version
-
v3.0.717 Sep 2021Nothing published for this version
-
v3.0.625 Aug 2021Nothing published for this version
-
v3.0.502 Nov 2020Nothing published for this version
-
v3.0.431 Mar 2020Nothing published for this version
-
v3.0.331 Oct 2019Nothing published for this version
-
v3.0.208 Jul 2019Nothing published for this version
-
v3.0.103 Apr 2019Nothing published for this version
-
v3.0.028 Feb 2019Nothing published for this version
-
v2.4.1206 Nov 2020Nothing published for this version
-
v2.4.1113 Mar 2019Nothing published for this version
-
v2.4.1003 Sep 2018Nothing published for this version
-
v2.4.926 Apr 2018Nothing published for this version
-
v2.4.814 Mar 2018Nothing published for this version
-
v2.4.724 Aug 2017Nothing published for this version
-
v2.4.611 Jul 2017Nothing published for this version
-
v2.4.516 Mar 2017Nothing published for this version
-
v2.4.418 Jan 2017Nothing published for this version
-
v2.4.319 Dec 2016Nothing published for this version
-
v2.4.217 Oct 2016Nothing published for this version
-
v2.4.127 Sep 2016Nothing published for this version
-
v2.4.025 Jun 2016Nothing published for this version
-
v2.3.916 Mar 2017Nothing published for this version
-
v2.3.819 Dec 2016Nothing published for this version
-
v2.3.706 Jun 2016Nothing published for this version
-
v2.3.602 Apr 2016Nothing published for this version
-
v2.3.501 Apr 2016Nothing published for this version
-
v2.3.420 Jan 2016Nothing published for this version
-
v2.3.319 Jul 2015Nothing published for this version
-
v2.3.216 Jun 2015Nothing published for this version
-
v2.3.108 Apr 2015Nothing published for this version
-
v2.3.025 Feb 2015Nothing published for this version
-
v2.2.1002 Apr 2016Nothing published for this version
-
v2.2.930 Mar 2016Nothing published for this version
-
v2.2.819 Jul 2015Nothing published for this version
-
v2.2.708 Apr 2015Nothing published for this version
-
v2.2.620 Feb 2015Nothing published for this version
-
v2.2.521 Dec 2014Nothing published for this version
-
v2.2.416 Nov 2014Nothing published for this version
-
v2.2.315 Nov 2014Nothing published for this version
-
v2.2.208 Nov 2014Nothing published for this version
-
v2.2.124 Aug 2014Nothing published for this version
-
v2.2.024 Jun 2014Nothing published for this version
-
v3.0.3.103 Jun 2020Nothing published for this version