← ClaudeAtlas

nette-httplisted

Invoke before working with the HTTP layer in Nette – the request, the response, sessions or cookies. Covers Nette\Http\Request (getUrl/UrlScript, getPost, getQuery, getCookie, getFile/getFiles, getHeader, getOrigin, isFrom, isSecured, isAjax, getRemoteAddress and the proxy trap), Nette\Http\Response (setCookie and SameSite, setHeader vs addHeader, redirect, setExpiration, headers-before-output), sessions (Session, SessionSection, set/get/remove, per-key expiration, the `session:` NEON section, autoStart), the Sec-Fetch based CSRF / same-origin protection and how to allow a legitimate cross-origin POST, and the SSRF guards UrlValidator and IPAddress. Also trigger for file uploads (FileUpload), Url vs UrlImmutable vs UrlScript, getBasePath/getRelativeUrl, cookie flags, and the `http:` config section. Not for authentication or the `security:` section (see nette-security) nor for building forms (see nette-forms).
nette/agent-plugins · ★ 44 · AI & Automation · score 81
Install: claude install-skill nette/agent-plugins
## Nette Http Installed with `composer require nette/http`. The framework registers `http.request` (`Nette\Http\Request`), `http.response` (`Nette\Http\Response`), `http.requestFactory` and `session.session` (`Nette\Http\Session`). All autowired – inject `Nette\Http\IRequest` / `Nette\Http\IResponse` / `Nette\Http\Session` by type; in presenters use `$this->getHttpRequest()`, `$this->getHttpResponse()`, `$this->getSession()` / `$this->getSession('sectionName')`. ### Request – read-only, already sanitized `Nette\Http\Request` is immutable; `RequestFactory::fromGlobals()` strips control characters and invalid UTF-8 from GET/POST/COOKIE and the URL. ```php $url = $httpRequest->getUrl(); // UrlScript, not a string $httpRequest->getQuery(); // all GET params; getQuery('id') for one (null if missing) $httpRequest->getPost('name'); // POST param or null $httpRequest->getCookie('lang'); // ?string; getCookies() for all $httpRequest->getHeader('User-Agent'); // ?string, case-insensitive; getHeaders() keys are lowercase $httpRequest->isSecured(); // HTTPS? $httpRequest->isAjax(); // X-Requested-With: XMLHttpRequest $httpRequest->getRemoteAddress(); // ?string $httpRequest->getBasicCredentials(); // ?array – since 3.2 NOT in $url->getUser()/getPassword() ``` **`getRemoteAddress()` and `isSecured()` are wrong behind a reverse proxy** until you list the proxy, otherwise you get the load balancer's IP and `h