mardi 22 mai 2018

Add multiple domains in x-frame-options on header with Laravel

I would like to add multiple domains in X-Frame-Options, because I must authorize facebook and messenger.

I tried many things, for example...

I created a middleware :

<?php

namespace App\Http\Middleware;

use Closure;

class FrameHeadersMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $response = $next($request);

        $response->header('X-Frame-Options', 'ALLOW FROM https://www.messenger.com/');
        $response->header('X-Frame-Options', 'ALLOW FROM https://www.facebook.com/');

        return $response;
    }
}

But only facebook is added...

enter image description here



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2IEtFKf
via IFTTT

Aucun commentaire:

Enregistrer un commentaire