From a964025a5db677e3d848f088b3eb6844f1eb7529 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 5 Dec 2020 20:41:32 +0300 Subject: [PATCH] closes #2317 --- 5-network/01-fetch/article.md | 2 +- 5-network/05-fetch-crossorigin/article.md | 60 +++++++++++------------ 5-network/06-fetch-api/article.md | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/5-network/01-fetch/article.md b/5-network/01-fetch/article.md index 8db2243b..688db2ba 100644 --- a/5-network/01-fetch/article.md +++ b/5-network/01-fetch/article.md @@ -27,7 +27,7 @@ let promise = fetch(url, [options]) - **`url`** -- the URL to access. - **`options`** -- optional parameters: method, headers etc. -Without `options`, that is a simple GET request, downloading the contents of the `url`. +Without `options`, this is a simple GET request, downloading the contents of the `url`. The browser starts the request right away and returns a promise that the calling code should use to get the result. diff --git a/5-network/05-fetch-crossorigin/article.md b/5-network/05-fetch-crossorigin/article.md index 0c142969..0bd1be06 100644 --- a/5-network/05-fetch-crossorigin/article.md +++ b/5-network/05-fetch-crossorigin/article.md @@ -97,39 +97,39 @@ After a while, networking methods appeared in browser JavaScript. At first, cross-origin requests were forbidden. But as a result of long discussions, cross-origin requests were allowed, but with any new capabilities requiring an explicit allowance by the server, expressed in special headers. -## Simple requests +## Safe requests There are two types of cross-origin requests: -1. Simple requests. +1. Safe requests. 2. All the others. -Simple Requests are, well, simpler to make, so let's start with them. +Safe Requests are simpler to make, so let's start with them. -A [simple request](http://www.w3.org/TR/cors/#terminology) is a request that satisfies two conditions: +A request is safe if it satisfies two conditions: -1. [Simple method](http://www.w3.org/TR/cors/#simple-method): GET, POST or HEAD -2. [Simple headers](http://www.w3.org/TR/cors/#simple-header) -- the only allowed custom headers are: +1. [Safe method](https://fetch.spec.whatwg.org/#cors-safelisted-method): GET, POST or HEAD +2. [Safe headers](https://fetch.spec.whatwg.org/#cors-safelisted-request-header) -- the only allowed custom headers are: - `Accept`, - `Accept-Language`, - `Content-Language`, - `Content-Type` with the value `application/x-www-form-urlencoded`, `multipart/form-data` or `text/plain`. -Any other request is considered "non-simple". For instance, a request with `PUT` method or with an `API-Key` HTTP-header does not fit the limitations. +Any other request is considered "unsafe". For instance, a request with `PUT` method or with an `API-Key` HTTP-header does not fit the limitations. -**The essential difference is that a "simple request" can be made with a `
` or a `