Origin
Web内容的源由用于访问它的URL 的方案(协议),主机(域名)和端口定义。只有当方案,主机和端口都匹配时,两个对象具有相同的起源。
某些操作仅限于同源内容,而可以使用 CORS 解除这个限制。
http://example.com/app1/index.html
http://example.com/app2/index.html |
same origin because same scheme (http ) and host (example.com ) |
http://Example.com:80
http://example.com |
same origin because a server delivers HTTP content through port 80 by default |
http://example.com/app1
https://example.com/app2 |
different schemes |
http://example.com
http://www.example.com
http://myapp.example.com |
different hosts |
http://example.com
http://example.com:8080 |
different ports |