diff options
author | julieng <julien.gattelier@gmail.com> | 2021-09-17 20:50:13 +0200 |
---|---|---|
committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-10-12 07:57:56 +0200 |
commit | 0fe03b92344c0f9b0d4ada2146d4480997ab2e25 (patch) | |
tree | b2b704c9e2987a769980ad0d619ff1bd879c7e34 /files/fr/web/http/headers/content-security-policy/form-action/index.md | |
parent | df12ec2617159d79d2ea959389358ef52423f9ff (diff) | |
download | translated-content-0fe03b92344c0f9b0d4ada2146d4480997ab2e25.tar.gz translated-content-0fe03b92344c0f9b0d4ada2146d4480997ab2e25.tar.bz2 translated-content-0fe03b92344c0f9b0d4ada2146d4480997ab2e25.zip |
convert content to md
Diffstat (limited to 'files/fr/web/http/headers/content-security-policy/form-action/index.md')
-rw-r--r-- | files/fr/web/http/headers/content-security-policy/form-action/index.md | 130 |
1 files changed, 59 insertions, 71 deletions
diff --git a/files/fr/web/http/headers/content-security-policy/form-action/index.md b/files/fr/web/http/headers/content-security-policy/form-action/index.md index fee4d1839f..2c62d630ec 100644 --- a/files/fr/web/http/headers/content-security-policy/form-action/index.md +++ b/files/fr/web/http/headers/content-security-policy/form-action/index.md @@ -12,102 +12,90 @@ tags: - form-action translation_of: Web/HTTP/Headers/Content-Security-Policy/form-action --- -<div>{{HTTPSidebar}}</div> +{{HTTPSidebar}} -<p>La directive HTTP {{HTTPHeader("Content-Security-Policy")}} (CSP) <code><strong>form</strong></code><strong><code>-action</code></strong> restreint les URL pouvant être utilisées comme cibles de soumissions de formulaires depuis un contexte donné.</p> +La directive HTTP {{HTTPHeader("Content-Security-Policy")}} (CSP) **`form`\*\***`-action`\*\* restreint les URL pouvant être utilisées comme cibles de soumissions de formulaires depuis un contexte donné. -<div class="warning"> -<p><strong>Attention :</strong> La question de savoir si <code>form-action</code> doit bloquer les redirections après une soumission de formulaire est encore <a href="https://github.com/w3c/webappsec-csp/issues/8">débattue</a> et les implantations des navigateurs sur cet aspect sont incohérentes (par exemple Firefox 57 ne les bloque pas, contrairement à Chrome 63).</p> -</div> +> **Attention :** La question de savoir si `form-action` doit bloquer les redirections après une soumission de formulaire est encore [débattue](https://github.com/w3c/webappsec-csp/issues/8) et les implantations des navigateurs sur cet aspect sont incohérentes (par exemple Firefox 57 ne les bloque pas, contrairement à Chrome 63). <table class="properties"> - <tbody> - <tr> - <th scope="row">Version de CSP</th> - <td>2</td> - </tr> - <tr> - <th scope="row">Type de directive</th> - <td>{{Glossary("Navigation directive")}}</td> - </tr> - <tr> - <th scope="row">{{CSP("default-src")}} par défaut</th> - <td>Non, ne pas la définir autorise toutes les adresses.</td> - </tr> - </tbody> + <tbody> + <tr> + <th scope="row">Version de CSP</th> + <td>2</td> + </tr> + <tr> + <th scope="row">Type de directive</th> + <td>{{Glossary("Navigation directive")}}</td> + </tr> + <tr> + <th scope="row">{{CSP("default-src")}} par défaut</th> + <td>Non, ne pas la définir autorise toutes les adresses.</td> + </tr> + </tbody> </table> -<h2 id="Syntaxe">Syntaxe</h2> +## Syntaxe -<p>Une ou plusieurs sources peuvent être utilisées pour cette directive :</p> +Une ou plusieurs sources peuvent être utilisées pour cette directive : -<pre class="syntaxbox">Content-Security-Policy: form-action <source>; -Content-Security-Policy: form-action <source> <source>; -</pre> + Content-Security-Policy: form-action <source>; + Content-Security-Policy: form-action <source> <source>; -<h3 id="Sources">Sources</h3> +### Sources -<p>{{page("fr/Web/HTTP/Headers/Content-Security-Policy/default-src", "Sources")}}</p> +{{page("fr/Web/HTTP/Headers/Content-Security-Policy/default-src", "Sources")}} -<h2 id="Exemples">Exemples</h2> +## Exemples -<h3 id="Configuration_par_balise_<meta>">Configuration par balise <meta></h3> +### Configuration par balise \<meta> -<pre class="brush: html"><meta http-equiv="Content-Security-Policy" content="form-action 'none'"></pre> +```html +<meta http-equiv="Content-Security-Policy" content="form-action 'none'"> +``` -<h3 id="Configuration_par_Apache">Configuration par Apache</h3> +### Configuration par Apache -<pre class="brush: bash"><IfModule mod_headers.c> +```bash +<IfModule mod_headers.c> Header set Content-Security-Policy "form-action 'none';" -</IfModule></pre> +</IfModule> +``` -<h3 id="Configuration_par_Nginx">Configuration par Nginx</h3> +### Configuration par Nginx -<pre class="brush: bash">add_header Content-Security-Policy "form-action 'none';"</pre> +```bash +add_header Content-Security-Policy "form-action 'none';" +``` -<h3 id="Cas_de_violation">Cas de violation</h3> +### Cas de violation -<p>Utiliser un élément {{HTMLElement("form")}} avec un attribut <code>action</code> défini à un script embarqué JavaScript résultera en une violation de CSP :</p> +Utiliser un élément {{HTMLElement("form")}} avec un attribut `action` défini à un script embarqué JavaScript résultera en une violation de CSP : -<pre class="brush: html; example-bad"><meta http-equiv="Content-Security-Policy" content="form-action 'none'"> +```html example-bad +<meta http-equiv="Content-Security-Policy" content="form-action 'none'"> -<form action="javascript:alert('Foo')" id="form1" method="post"> - <input type="text" name="fieldName" value="fieldValue"> - <input type="submit" id="submit" value="submit"> -</form> +<form action="javascript:alert('Foo')" id="form1" method="post"> + <input type="text" name="fieldName" value="fieldValue"> + <input type="submit" id="submit" value="submit"> +</form> // Error: Refused to send form data because it violates the following -// Content Security Policy directive: "form-action 'none'".</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">Statut</th> - <th scope="col">Commentaire</th> - </tr> - <tr> - <td>{{specName("CSP 3.0", "#directive-form-action", "form-action")}}</td> - <td>{{Spec2('CSP 3.0')}}</td> - <td>Inchangé.</td> - </tr> - <tr> - <td>{{specName("CSP 1.1", "#directive-form-action", "form-action")}}</td> - <td>{{Spec2('CSP 1.1')}}</td> - <td>Définition initiale.</td> - </tr> - </tbody> -</table> +// Content Security Policy directive: "form-action 'none'". +``` + +## Spécifications + +| Spécification | Statut | Commentaire | +| ------------------------------------------------------------------------------------ | ---------------------------- | -------------------- | +| {{specName("CSP 3.0", "#directive-form-action", "form-action")}} | {{Spec2('CSP 3.0')}} | Inchangé. | +| {{specName("CSP 1.1", "#directive-form-action", "form-action")}} | {{Spec2('CSP 1.1')}} | Définition initiale. | -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> +## Compatibilité des navigateurs -<p>{{Compat("http.headers.csp.Content-Security-Policy.form-action")}}</p> +{{Compat("http.headers.csp.Content-Security-Policy.form-action")}} -<h2 id="Voir_aussi">Voir aussi</h2> +## Voir aussi -<ul> - <li>{{HTTPheader("Content-Security-Policy")}}</li> - <li>{{HTMLElement("form")}}</li> -</ul> +- {{HTTPheader("Content-Security-Policy")}} +- {{HTMLElement("form")}} |