Skip to content

Commit

Permalink
20210419 TIL
Browse files Browse the repository at this point in the history
  • Loading branch information
genie-youn committed Apr 18, 2021
1 parent d3c57ab commit a6c96a3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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*
8 changes: 8 additions & 0 deletions Dictionary/Dictionary.md
Original file line number Diff line number Diff line change
@@ -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 의 정보를 바탕으로 브라우저가 표준에 정의된 일련의 절차에 따라 새로운 요청을 생성하여 전송하게 된다.
Expand Down
6 changes: 6 additions & 0 deletions JavaScript/javascript_에는_assert_가_없을까?.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` 가 유명하나 더 이상 개발이 안되는 것으로 보인다.

필요하다면 하나 만들어 쓰도록 하자.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 3.2 CORS protocol

서로 다른 origin의 응답을 공유하거나 HTML의 form 요소에서 가능한 것 보다 더 다양한 `fetchs` 를 활용하기 위해 CORS protocol 은 존재한다. HTTP 위에 계층화 되어 있으며 응답이 다른 origins 에 공유될 수 있음을 선언한다.

0 comments on commit a6c96a3

Please sign in to comment.