Nette Http 3.4.0 has been released
- David Grudl
- founder | 8310
A new version of Nette Http 3.4.0 is out. The two headline features each got their own article:
- SSRF protection – new
UrlValidatorandIPAddressclasses block Server-Side Request Forgery in a single line, covering private ranges, cloud metadata, IPv4-mapped IPv6 and DNS rebinding (article) - End of CSRF cookies – the new
Request::isFrom()method detects a request's origin from theSec-Fetch-*headers, so protection becomes stateless and can finally tell same-origin from same-site (article)
Other new features:
- Modern cookies:
setCookie()now sendsMax-Age, supports partitioned cookies (CHIPS) viapartitioned: true, and auto-enforcesSecureforSameSite=Noneor partitioned cookies - New
SameSiteenum (SameSite::Laxetc.) accepted bysetCookie()andSession::setCookieParameters(); the old string constants are deprecated - Unified expiration handling across
setCookie(),Session::setExpiration()and session sections: a number is a relative number of seconds, a string is an interval ('20 minutes') or a date;setCookie()also acceptsDateTimeInterface. A session cookie is now represented bynull detectLanguage()understands the*wildcard in theAccept-Languageheader (commonly sent by API clients and bots)
Changes:
isSameSite()is deprecated and now delegates toisFrom()- Passing an absolute UNIX timestamp as expiration is deprecated
- Requires PHP 8.3+
- deprecated
Request::getRemoteHost()returnsnull; the long-deprecatedUserStorageclass was removed
Full release: https://github.com/…s/tag/v3.4.0