Add Access-Control-Allow-Origin

Cross-site HTTP requests are HTTP requests for resources from a different domain than the domain of the resource making the request. For instance, a resource loaded from Domain A ( such as an HTML web page, makes a request for a resource on Domain B (, such as an image, using the img element (

Most of times it's relevant when doing Ajax requests. If you want to make them possible you need to actively enable it.

To enable this, you ether have to set it as a server configuration or directly as a header of the Symfony\Component\HttpFoundation\Response class.

$response->headers->set('Access-Control-Allow-Origin', '*');