From a6c96a3123e03a13697d0887ac5110f6a3b970dd Mon Sep 17 00:00:00 2001 From: jisoo youn Date: Mon, 19 Apr 2021 07:29:52 +0900 Subject: [PATCH] 20210419 TIL --- ..._\354\210\230_\354\236\210\354\235\204\352\271\214.md" | 8 +++++++- Dictionary/Dictionary.md | 8 ++++++++ ...\352\260\200_\354\227\206\354\235\204\352\271\214?.md" | 6 ++++++ .../ECMAScript/3-HTTP-extensions/3-2-CORS-protocol.md" | 3 +++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 "\353\240\210\355\215\274\353\237\260\354\212\244\353\262\210\354\227\255/ECMAScript/3-HTTP-extensions/3-2-CORS-protocol.md" diff --git "a/Browser/Preflight_\354\232\224\354\262\255\354\227\220_\355\227\244\353\215\224\353\245\274_\354\266\224\352\260\200\355\225\240_\354\210\230_\354\236\210\354\235\204\352\271\214.md" "b/Browser/Preflight_\354\232\224\354\262\255\354\227\220_\355\227\244\353\215\224\353\245\274_\354\266\224\352\260\200\355\225\240_\354\210\230_\354\236\210\354\235\204\352\271\214.md" index 02c2447..16d6ba7 100644 --- "a/Browser/Preflight_\354\232\224\354\262\255\354\227\220_\355\227\244\353\215\224\353\245\274_\354\266\224\352\260\200\355\225\240_\354\210\230_\354\236\210\354\235\204\352\271\214.md" +++ "b/Browser/Preflight_\354\232\224\354\262\255\354\227\220_\355\227\244\353\215\224\353\245\274_\354\266\224\352\260\200\355\225\240_\354\210\230_\354\236\210\354\235\204\352\271\214.md" @@ -47,4 +47,10 @@ https://fetch.spec.whatwg.org/#cors-preflight-fetch 2. *headerNames* 는 `Access-Control-Allow-Methods` 의 extracting header list values 와 *response* 의 header list의 결과가 된다. ?? 3. *methods* 나 *headerNames* 가 실패한다면 network error 를 반환한다. 4. *methods* 가 null 이고 *request* 의 use-CORS-preflight-flag 가 설정되어 있으면 *methods* 를 *request* 의 method 를 포함하는 새로운 리스트로 설정한다. - 5. + 5. 만약 *request* 의 method 가 *methods* 에 존재하지 않으면 *request* 의 method 가 CORS-safelisted mehtod가 아니고 *request* 의 credentials mode가 "include" 또는 *methods* 가 `*` 를 포함하고 있지 않다면 network error를 반환한다... ? + 6. 만약 request의 header list의 이름들 중 하나가 CORS non-wildcard request-header name 이고 *headerNames* 의 항목과 byte-case-insensitive match 하지 않으면 network error를 반환한다. + 8. *max-age* 는 *response* 의 헤더 리스트 중 `Access-Control-Max-Age` 의 extracting header list values 의 결과가 된다. + 9. 만약 *max-age* 가 실패 혹은 null 이라면 max-age를 5로 설정한다. + 10. 만약 *max-age* 가 max-age 에 부여된 값보다 큰 경우 `max-age` 를 부여된 값으로 설정한다. + 11. 만약 user agent 가 cache 를 제공하지 않으면 *response* 를 반환 + 12. *methods* 의 각각의 *method* diff --git a/Dictionary/Dictionary.md b/Dictionary/Dictionary.md index 3f3841d..9ead10e 100644 --- a/Dictionary/Dictionary.md +++ b/Dictionary/Dictionary.md @@ -1,9 +1,17 @@ # HTTP +### fetches +https://fetch.spec.whatwg.org/#concept-fetch + ### HTTP fetch와 HTTP-network-or-cache fetch +### CORS Protocol + ### CORS-unsafe request-header names +### Origins +https://html.spec.whatwg.org/multipage/origin.html#concept-origin + ### Preflight Request CORS Protocol 을 정상적으로 이행할 수 있는지 확인하기 위해 request 를 요청하기 전 이루어 지는 사전 요청으로, 요청하려는 request 의 정보를 바탕으로 브라우저가 표준에 정의된 일련의 절차에 따라 새로운 요청을 생성하여 전송하게 된다. diff --git "a/JavaScript/javascript_\354\227\220\353\212\224_assert_\352\260\200_\354\227\206\354\235\204\352\271\214?.md" "b/JavaScript/javascript_\354\227\220\353\212\224_assert_\352\260\200_\354\227\206\354\235\204\352\271\214?.md" index ba5583d..a6b52af 100644 --- "a/JavaScript/javascript_\354\227\220\353\212\224_assert_\352\260\200_\354\227\206\354\235\204\352\271\214?.md" +++ "b/JavaScript/javascript_\354\227\220\353\212\224_assert_\352\260\200_\354\227\206\354\235\204\352\271\214?.md" @@ -32,3 +32,9 @@ for (let number = 2; number <= 5; number +=1) { 2.6k 의 [power-assert](https://github.com/power-assert-js/power-assert) 가 있긴 한데 더 이상 업데이트 되지는 않아 보인다. Node는 내장된 [라이브러리](https://nodejs.org/api/assert.html#assert_assert) 가 존재한다. + +#### 정리하면 +javascript 표준으로 정의된 `assert` 는 없으며, proposal 은 제안되었으나 별 다른 논의가 되질 않고 있다. +Node 는 빌트인 라이브러리를 지원하며 3rd 라이브러리로는 `power-assert` 가 유명하나 더 이상 개발이 안되는 것으로 보인다. + +필요하다면 하나 만들어 쓰도록 하자. diff --git "a/\353\240\210\355\215\274\353\237\260\354\212\244\353\262\210\354\227\255/ECMAScript/3-HTTP-extensions/3-2-CORS-protocol.md" "b/\353\240\210\355\215\274\353\237\260\354\212\244\353\262\210\354\227\255/ECMAScript/3-HTTP-extensions/3-2-CORS-protocol.md" new file mode 100644 index 0000000..91c32ae --- /dev/null +++ "b/\353\240\210\355\215\274\353\237\260\354\212\244\353\262\210\354\227\255/ECMAScript/3-HTTP-extensions/3-2-CORS-protocol.md" @@ -0,0 +1,3 @@ +# 3.2 CORS protocol + +서로 다른 origin의 응답을 공유하거나 HTML의 form 요소에서 가능한 것 보다 더 다양한 `fetchs` 를 활용하기 위해 CORS protocol 은 존재한다. HTTP 위에 계층화 되어 있으며 응답이 다른 origins 에 공유될 수 있음을 선언한다.