aboutsummaryrefslogtreecommitdiff
path: root/files/fr/glossary/origin/index.html
blob: 751adb267d032b9dce0ceb2c459b342355ff08d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: Origine
slug: Glossaire/Origine
tags:
  - Glossaire
  - Mécanismes web
  - origine
translation_of: Glossary/Origin
---
<h2 id="Résumé">Résumé</h2>

<p>L'<strong>origine</strong> d'une application web est définie par le schéma (protocole), l'hôte (domaine) et le port de l'{{Glossary("URL")}} utilisée pour y accéder. Deux objets ont la même origine seulement quand le schéma, l'hôte et le port correspondent.</p>

<p>Quelques opérations sont limitées au contenu de même origine, et cette restriction peut être levée avec <a href="https://developer.mozilla.org/fr/docs/Glossaire/CORS">CORS</a>.</p>

<h2 id="Exemples_de_même_origine">Exemples de même origine</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <td style="width: 50%;"><code>http://example.com/app1/index.html</code><br>
    <code>http://example.com/app2/index.html</code></td>
   <td style="width: 50%;">même origine parce que même schéma (<code>http</code>) et même hôte (<code>example.com</code>)</td>
  </tr>
  <tr>
   <td style="width: 50%;"><code>http://Example.com:80</code><br>
    <code>http://example.com</code></td>
   <td style="width: 50%;">même origine parce que un serveur <span class="short_text" id="result_box" lang="fr"><span>délivre du contenu HTTP via le port 80 par défaut</span></span></td>
  </tr>
 </tbody>
</table>

<h2 id="Exemples_d'origines_différentes">Exemples d'origines différentes</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <td style="width: 50%;"><code>http://example.com/app1</code><br>
    <code>https://example.com/app2</code></td>
   <td>Schémas différents</td>
  </tr>
  <tr>
   <td style="width: 50%;"><code>http://example.com</code><br>
    <code>http://www.example.com</code><br>
    <code>http://myapp.example.com</code></td>
   <td style="width: 50%;">Hôtes différents</td>
  </tr>
  <tr>
   <td style="width: 50%;"><code>http://example.com</code><br>
    <code>http://example.com:8080</code></td>
   <td style="width: 50%;">Ports différents</td>
  </tr>
 </tbody>
</table>

<h2 id="Pour_en_savoir_plus">Pour en savoir plus</h2>

<p>Voir <a href="https://developer.mozilla.org/fr/docs/Web/JavaScript/Same_origin_policy_for_JavaScript" title="/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript">Same-origin policy</a> <em>(politique de même origine)</em> pour plus d'informations.</p>