--- breadcrumb: - What's new? - Version 3.3 summary-order: 7;97 keywords: - release - new features - "3.3" --- # What's new in 3.3 Version 3.3 secures applications running behind a reverse proxy, gives forms full control over their mapping, and hardens the HTTP client. To upgrade, follow [Upgrading from version 3.2 to 3.3](../getting-started/upgrading.md#upgrading-from-version-32-to-33). ## Secured reverse-proxy prefixes When a reverse proxy exposes your application under a prefix such as `/app`, the `X-Forwarded-Prefix` header is now accepted only from the proxies you trust. A client can no longer forge it to alter the generated URLs. ```json { "berlioz": { "proxies": { "trusted": ["10.0.0.1"] }, "router": { "X-Forwarded-Prefix": true, "rewriteRequestUri": true } } } ``` With `rewriteRequestUri`, the request URI seen by your controllers includes the prefix, so the URLs derived from it (pagination, redirections to the current page) are correct. See [Reverse-proxy prefixes](../http/routing.md#reverse-proxy-prefixes). ## Custom form mapping The `mapped` option of a form element accepts a `FormMapping` object. You decide how the element reads its value from the mapped object and writes it back, for example to reach a nested property: ```php $form->add('display_name', Text::class, [ 'mapped' => new FormMapping( get: fn(object $user): string => $user->profile->name, set: function (object $user, mixed $value): bool { $user->profile->name = $value; return true; }, ), ]); ``` See [Custom mapping](../guides/forms.md#custom-mapping). ## Safer HTTP client redirections When a redirection leads to another origin, the HTTP client removes the `Authorization`, `Proxy-Authorization` and `Cookie` headers you supplied. Declare your own secret headers so that they are removed too: ```php $client = new Client([ 'headers' => [ 'Authorization' => 'Bearer example-token', 'X-Api-Key' => 'example-api-key', ], 'redirectSensitiveHeaders' => ['X-Api-Key'], ]); ``` Cookies are also scoped more strictly: a cookie is only stored for, and sent to, the hosts and paths it belongs to. See [Redirect security](../components/http-client.md#redirect-security). ## Other new features - **Debug console:** the HTTP section shows the status, the protocol version and the headers of the response. See [HTTP response](../getting-started/debug.md#http-response). - **Error logging:** server errors caught by the framework are written to the PHP error log, even when debug mode is disabled. See [Error logging](../http/error-handler.md#error-logging). ## Security fixes - **HTML selector:** values interpolated in XPath expressions are encoded, which prevents XPath injection. - **Mailer:** MIME boundaries and attachment identifiers use cryptographically secure randomness. ## Deprecations Handling a trusted forwarded prefix without `berlioz.router.rewriteRequestUri` is deprecated. See [Preparing for version 4](../getting-started/upgrading.md#preparing-for-version-4).