Headers and CORS
Headers middleware is used to set up request/response headers and control CORS for your application.
CORS
To enable CORS headers add the following section to your configuration.
.rr.yaml
Make sure to declare "headers" middleware.
Since RoadRunner v2023.2.0 following changes were made:
Ability to define status code of successful OPTIONS request via
options_success_status
config;Debug flag (
debug: true/false
) was added to enable additional output to debug CORS issues;Allowed to define multiple
allowed_origin
values separated by comma;CORS requests are handled using rs/cors package.
Custom headers for Response or Request
You can control additional headers to be set for outgoing responses and headers to be added to the request sent to your application.
.rr.yaml
Last updated