FETCH를 통해 데이터를 전달할 때 mode라는 것을 알게되었다. 모드에 따라 헤더 요청을 보낼 수 있는 데이터가 달라지느 는 것 같다.
CORS가 보낼 수 있는 헤더 데이터
- `Accept`
- `Accept-Language`
- `Content-Language`
- `Content-Type`
NO-CORS
- `Cache-Control`
- `Content-Language`
- `Content-Length`
- `Content-Type`
- `Expires`
- `Last-Modified`
- `Pragma`
- Any item in list that is not a forbidden response-header name.
- `Accept-Charset`
- `Accept-Encoding`
- `Access-Control-Request-Headers`
- `Access-Control-Request-Method`
- `Connection`
- `Content-Length`
- `Cookie`
- `Cookie2`
- `Date`
- `DNT`
- `Expect`
- `Host`
- `Keep-Alive`
- `Origin`
- `Referer`
- `Set-Cookie`
- `TE`
- `Trailer`
- `Transfer-Encoding`
- `Upgrade`
- `Via
이외에도 Auhorization도 보낼 수 있다.
출처
https://fetch.spec.whatwg.org/#cors-safelisted-request-header
Fetch Standard
fetch.spec.whatwg.org