diff options
Diffstat (limited to 'files/fr/web/http/headers/content-security-policy/img-src/index.md')
-rw-r--r-- | files/fr/web/http/headers/content-security-policy/img-src/index.md | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/files/fr/web/http/headers/content-security-policy/img-src/index.md b/files/fr/web/http/headers/content-security-policy/img-src/index.md new file mode 100644 index 0000000000..cbaf0a5798 --- /dev/null +++ b/files/fr/web/http/headers/content-security-policy/img-src/index.md @@ -0,0 +1,95 @@ +--- +title: 'CSP: img-src' +slug: Web/HTTP/Headers/Content-Security-Policy/img-src +tags: + - CSP + - Content-Security-Policy + - Directive + - HTTP + - Image + - Reference + - Security + - Sécurité + - img-src + - source +translation_of: Web/HTTP/Headers/Content-Security-Policy/img-src +--- +<div>{{HTTPSidebar}}</div> + +<p>La directive HTTP {{HTTPHeader("Content-Security-Policy")}} <code><strong>img-src</strong></code> sépcifie les sources valides d'images et de favicons.</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Version de CSP</th> + <td>1</td> + </tr> + <tr> + <th scope="row">Type de directive</th> + <td>{{Glossary("Fetch directive")}}</td> + </tr> + <tr> + <th scope="row">{{CSP("default-src")}} par défaut</th> + <td>Oui, si cette directive est absente, l'agent utilisateur consultera la directive <code>default-src</code></td> + </tr> + </tbody> +</table> + +<h2 id="Syntaxe">Syntaxe</h2> + +<p>Une ou plusieurs sources peuvent être autorisées pour cette directive :</p> + +<pre class="syntaxbox">Content-Security-Policy: img-src <source>; +Content-Security-Policy: img-src <source> <source>; +</pre> + +<h3 id="Sources">Sources</h3> + +<p>{{page("fr/Web/HTTP/Headers/Content-Security-Policy/default-src", "Sources")}}</p> + +<h2 id="Exemples">Exemples</h2> + +<h3 id="Cas_de_violation">Cas de violation</h3> + +<p>Soit cet en-tête CSP :</p> + +<pre class="brush: bash">Content-Security-Policy: img-src https://example.com/</pre> + +<p>Cet élément {{HTMLElement("img")}} est bloqué et ne se chargera pas :</p> + +<pre class="brush: html"><img src="https://not-example.com/foo.jpg" alt="example picture"></pre> + +<h2 id="Spécifications">Spécifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Spécification</th> + <th scope="col">Statut</th> + <th scope="col">Commentaire</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{specName("CSP 3.0", "#directive-img-src", "img-src")}}</td> + <td>{{Spec2('CSP 3.0')}}</td> + <td>Inchangé.</td> + </tr> + <tr> + <td>{{specName("CSP 1.1", "#directive-img-src", "img-src")}}</td> + <td>{{Spec2('CSP 1.1')}}</td> + <td>Définition initiale.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> + +<p>{{Compat("http.headers.csp.Content-Security-Policy.img-src")}}</p> + +<h2 id="Voir_aussi">Voir aussi</h2> + +<ul> + <li>{{HTTPHeader("Content-Security-Policy")}}</li> + <li>{{HTMLElement("img")}}</li> +</ul> |