CORS
λ Cross-Origin Resource Sharing (κ΅μ°¨ μΆμ² 리μμ€ κ³΅μ )μ μ€μλ§μ΄λ€.
λΈλΌμ°μ λ 보μμμ μ΄μ λ‘ λ€λ₯Έ μΆμ²μ HTTP μμ²μ μ ννλ€.
CORS 체μ λ λΈλΌμ°μ μ μλ² κ°μ μμ ν κ΅μ°¨ μΆμ² μμ² λ° λ°μ΄ν° μ μ‘μ μ§μνλ€.
μλ² μ¬μ΄λμμ Access-Control-Allow-Origin
ν€λμ μλ΅κ°μ λ΄μμΌλ‘μ λμνλ€.
μλ² λ°μ΄ν°μ μ¬μ΄λ μ΄ννΈλ₯Ό μΌμΌν¬ μ μλ HTTP λ©μλ(GET μ μΈ)μ λνμ¬
preflight(μ¬μ μ λ¬) νμ¬ λ©μλλ₯Ό μμ²νκ³ , μλ²κ° νκ° ν κ²½μ° μ€μ μμ² λ³΄λ΄λλ‘ νλ€.
μ΄ λ, μλ²λ ν΄λΌμ΄μΈνΈ(λΈλΌμ°μ )μκ² μΈμ¦μ 보λ₯Ό ν¨κ» 보λ΄μΌ νλ€λ 쑰건μ μλ €μ€ μλ μλ€.
HTTP/1.1 200 OK
Date: Mon, 01 Dec 2008 00:23:53 GMT
Server: Apache/2
Access-Control-Allow-Origin: *
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/xml
Access-Control-Allow-Origin
μ *(μμΌλ μΉ΄λ)κ° ν¬ν¨ λλ€.
HTTP/1.1 200 OK
Date: Mon, 01 Dec 2008 00:23:53 GMT
Server: Apache/2
Access-Control-Allow-Origin: https://foo.example
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/xml
Access-Control-Allow-Origin
μ νΉμ URLμ΄ ν¬ν¨ λλ€.