동일-출처 정책
![]() | 이 문서는 영어 위키백과의 Same-origin policy 문서를 번역하여 문서의 내용을 확장할 필요가 있습니다. |
HTTP |
---|
![]() |
요청 방식 |
헤더 필드 |
상태 코드 |
동일-출처 정책(영어: same-origin policy)는 웹 애플리케이션의 중요한 보안 모델이다.
동일-출처 정책은 주로 스크립트로부터의 데이터 접근에 적용된다. 즉, 일치하는 HTML 태그를 경유하는 이미지, CSS, 스크립트 등 출처를 경유하여 리소스를 임베드하는 것은 제한되지 않는다.[1] (글꼴은 잘 알려진 예외임[2])
출처 결정 규칙[편집]
비교 대상 URL | 결과 | 이유 |
---|---|---|
http://www.example.com/dir/page2.html | 성공 | 프로토콜, 호스트, 포트가 동일 |
http://www.example.com/dir2/other.html | 성공 | 프로토콜, 호스트, 포트가 동일 |
http://username:password@www.example.com/dir2/other.html | 성공 | 프로토콜, 호스트, 포트가 동일 |
http://www.example.com:81/dir/other.html | 실패 | 프로토콜, 호스트가 동일하지만 포트가 다름 |
https://www.example.com/dir/other.html[깨진 링크(과거 내용 찾기)] | 실패 | 프로토콜이 다름 |
http://en.example.com/dir/other.html | 실패 | 호스트가 다름 |
http://example.com/dir/other.html | 실패 | 호스트가 다름 (정확한 일치 필요) |
http://v2.www.example.com/dir/other.html | 실패 | 호스트가 다름 (정확한 일치 필요) |
http://www.example.com:80/dir/other.html | 상황에 따라 | 포트 명시적. 브라우저의 구현에 따라 결과가 다를 수 있음. |
같이 보기[편집]
각주[편집]
- ↑ Kemp, John (2011년 2월 4일). “Security on the Web”. 2018년 7월 24일에 확인함.
The same-origin policy states that a document from one unique origin may only load resources from the origin from which the document was loaded. In particular this applies to XMLHttpRequest calls made from within a document. Images, CSS and dynamically-loaded scripts are not subject to same-origin policy.
- ↑ “@font-face”. 《MDN Web Docs》 (미국 영어). 2018년 7월 24일에 확인함.
Web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless HTTP access controls are used to relax this restriction.
외부 링크[편집]
![]() |
이 글은 인터넷에 관한 토막글입니다. 여러분의 지식으로 알차게 문서를 완성해 갑시다. |