Download the PHP package epilgrim/modify-request-headers-bundle without Composer
On this page you can find all versions of the php package epilgrim/modify-request-headers-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download epilgrim/modify-request-headers-bundle
More information about epilgrim/modify-request-headers-bundle
Files in epilgrim/modify-request-headers-bundle
Package modify-request-headers-bundle
Short Description Symfony bundle to inject request headers
License MIT
Homepage http://github.com/Epilgrim/ModifyRequestHeadersBundle
Informations about the package modify-request-headers-bundle
ModifyRequestHeadersBundle
This bundle allows to add arbitrary request headers to the Request object.
The use case that forced me to develop it, was because my application is behind a reverse proxy, wich is not setting the headers x-forwarded-proto. Thus, links sended by mail had an incorrect protocol.
Features include:
- Set the custom headers
- Set the priority we want the listener to run when the kernel event.
Installation
- Download EpilgrimModifyRequestHeadersBundle using composer
- Enable the Bundle
- Configure your application's config.yml
Step 1: Download EpilgrimModifyRequestHeadersBundle using composer
Add EpilgrimModifyRequestHeadersBundle in your composer.json:
And then run
Step 2: Enable the bundle
Enable the bundle in the kernel:
- Configure your application's config.yml
You can add as many headers as you want.
Notes
It's important to note that the listener_priority must be set higher than the subsequent listener making use of the headers. For example, if you modify the x_forwarded_proto, it is used by the RouterListener (running with priority 32). Thus, you must set something higher. It defaults to 64. If the key epilgrim_modify_request_headers is not added to app/config/config.yml, then the listener won´t be registered.
License
This bundle is under the MIT license.
Reporting an issue or a feature request
Issues and feature requests are tracked in the Github issue tracker.