How to upload an image if I am using contentSecurityPolicy?

0

Good morning everyone

I am working on a project in laravel and install the library

Secure Headers

Everything works fine for the configuration of the css and the javscript, but I have a section of my project that I have to load images and when I try it I get the following error:

In case you can not see the image says:

  

Refused to load the image 'data: image / jpeg; base64 / 9J / 4AAQSkZJRgABAQEASABIAAD / 4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP / bAEMACQYGCAYFCQgHCAoJCQoNFg4NDAwNGhMUEBYfHCEgHxweHiMnMiojJS8lHh4rOywvMzU4ODghKj1BPDZBMjc4Nf / bAEMBCQoKDQsNGQ4OGTUkHiQ1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1Nf / CABEIAQQBzAMBIgACEQEDEQH / xAAbAAEAAgMBAQAAAAAAAAAAAAAABAUCAwYBB // EABcBAQEBAQAAAAAAAAAAAAAAAAABAgP / 2gAMAwEAAhADEAAAAevAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPD1qjk1AkG8AAAAAAAAAAAAAAAAAAAAAA8PWrSkvyCqVhr9R5mMffRhljsMt0cSHns0AAAAAAAAAAAAA ... WmHHjyKChe3mDtC4BIwnN1hjpZVHXLb6y8tlv6KyJXbU koS7xS3n1mcs3wTKKMXEPJ1JHA9Jleb + + + 0cyvxZ9p063WD7ypFYoK6nO1ug 0P6ZB6 / trBoc + faBy32g0Zef5 + r02oMqwFhHxA / Mdp + lrnN9Nlitf21ONvDghTkTkTrGWdPQRYcx7qWe + 5 + ZbvMB + 8SXwukbW0rGJysUnr + hTBJryawm3pCxO2JqJND9uvWJc1l4ixwjqXvqtTbrU0A / r1l27XA5Ta7fdLy3 / HE7YPpBe8 / URw5bj + A0GxOYyUCVpb1cYuYn49lIRk1fPa + tMFDdE0 / wBL6kuNNnGxpZGh + 8bmN4RpYNOl + h + 9IjuFEvKfog2USk7METK6K + kN + 8 / Ii6OmVKa + iHER76rwExxjwTS / T / bQEau / ofakgH + jKjvRvfpXr41hOF + E4ntP5jwf0u8eD + rzHCFw / FmXrkhGHzdzXG6iPtcq7Y4VPluaFiCpv / oXrZDp / wDKP // Z 'because it violates the following Content Security Policy directive: "img-src' self ' link link ".

and you are in my configuration in the secure-headers file

'img-src' => [
        'allow' => [
            $protocol.'www.google-analytics.com',
            $protocol.'placehold.it',

        ],
        'self' => true,
        'data' => true,
    ],

I upload the image with a

<input type="file" name="img">

What kind of configuration do I have to do to be able to add the images?

    
asked by j ch 10.10.2018 в 20:34
source

0 answers