Skip to content

Commit ada8891

Browse files
committed
Translated "Cross-domain requests"
1 parent b98c982 commit ada8891

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

5-network/12-server-sent-events/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,25 @@ eventSource.onmessage = function(event) {
6464
// или eventSource.addEventListener('message', ...)
6565
```
6666

67-
### Cross-domain requests
67+
### Кросс-доменные запросы
6868

69-
`EventSource` supports cross-origin requests, like `fetch` any other networking methods. We can use any URL:
69+
`EventSource`, как и `fetch`, поддерживает кросс-доменные запросы. Мы можем использовать такой URL:
7070

7171
```js
7272
let source = new EventSource("https://another-site.com/events");
7373
```
7474

75-
The remote server will get the `Origin` header and must respond with `Access-Control-Allow-Origin` to proceed.
75+
Сервер получит заголовок `Origin` и должен будет ответить с заголовком `Access-Control-Allow-Origin`.
7676

77-
To pass credentials, we should set the additional option `withCredentials`, like this:
77+
Чтобы передать авторизирующие заголовки, нужно передать дополнительный аргумент `withCredentials`:
7878

7979
```js
8080
let source = new EventSource("https://another-site.com/events", {
8181
withCredentials: true
8282
});
8383
```
8484

85-
Please see the chapter <info:fetch-crossorigin> for more details about cross-domain headers.
85+
Более подробное описание кросс-доменных заголовков можете прочитать в главе <info:fetch-crossorigin>.
8686

8787

8888
## Переподключение

0 commit comments

Comments
 (0)