官术网_书友最值得收藏!

  • CORS Essentials
  • Rajesh Gunasundaram Randall Goya
  • 209字
  • 2021-07-09 19:53:41

Considering the origin of entities

Access to DOM elements is allowed only when the request scheme, hostname, and port number match those of the current URI. A subdomain cannot share DOM elements with the parent domain.

  • Scheme in web applications is typically http:// or https://
  • Hostname is typically the domain name plus TLD, or the unique IP address
  • Port number:
    • Typically, port 80 is implicit in http://
    • 443 for SSL over https://

If the Scheme, Hostname, and port number do not match the DOM element, then resource sharing is prohibited as they do not share the same origin. Considering the domain http://www.example.com, the following table provides various combinations of matching and mismatching origins:

Internet Explorer exception policy

Internet Explorer (IE) implements two major differences when it comes to the same-origin policy:

  • IE Trust Zones allow different domains: If both domains are in a highly trusted zone, then the same-origin policy limitations are not applied.
  • Port is ignored: IE ignores the port in same origin components. These URIs are considered from the same origin:
    • http://www.example.com:80/dir/page1.html
    • http://www.example.com:81/dir/page1.html

      Tip

      These exceptions in Internet Explorer are non-standard and are not supported in other browsers. If an application is only viewed in Windows RT mobile or Internet Explorer, then these exceptions could be useful.

主站蜘蛛池模板: 外汇| 绥滨县| 瑞丽市| 永德县| 招远市| 辰溪县| 藁城市| 金寨县| 治县。| 宜君县| 融水| 荆州市| 元谋县| 香港 | 丹寨县| 福贡县| 建昌县| 宁城县| 台前县| 德庆县| 开阳县| 察哈| 鄂托克前旗| 新泰市| 饶平县| 安阳县| 龙南县| 宜城市| 上高县| 永定县| 宁安市| 新巴尔虎左旗| 色达县| 罗山县| 长春市| 泾源县| 永登县| 西平县| 开原市| 工布江达县| 卫辉市|