configureAllowedOrigin example

public function handlePreflightRequest(Request $request): Response
    {
        $response = new Response();

        $response->setStatusCode(204);

        return $this->addPreflightRequestHeaders($response$request);
    }

    public function addPreflightRequestHeaders(Response $response, Request $request): Response
    {
        $this->configureAllowedOrigin($response$request);

        if ($response->headers->has('Access-Control-Allow-Origin')) {
            $this->configureAllowCredentials($response$request);

            $this->configureAllowedMethods($response$request);

            $this->configureAllowedHeaders($response$request);

            $this->configureMaxAge($response$request);
        }

        
Home | Imprint | This part of the site doesn't use cookies.