Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fetch: Cross-Origin Requests#382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dolgachio merged 2 commits intojavascript-tutorial:masterfromNordtonito:master
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
We need `Origin`,because sometimes`Referer`is absent. For instance, when we`fetch` HTTP-page from HTTPS (access less secure from more secure),then there's no `Referer`.
Нам потрібен `Origin`,тому що іноді`Referer`відсутній. Наприклад, коли ми запитуємо через`fetch` HTTP-сторінку з HTTPS (доступ до менш безпечного з більш безпечного),тоді немає `Referer`.

The[Content Security Policy](http://en.wikipedia.org/wiki/Content_Security_Policy)may forbid sending a `Referer`.
[Content Security Policy](http://en.wikipedia.org/wiki/Content_Security_Policy)може забороняти надсилання `Referer`.

As we'll see, `fetch`has options that prevent sending the`Referer`and even allow to change it (within the same site).
Як ми побачимо, `fetch`має параметри, які забороняють надсилати`Referer`і навіть дозволяють змінювати його (в межах того самого сайту).

By specification, `Referer`is an optionalHTTP-header.
За специфікацією `Referer`є необов'язковимHTTP-заголовком.

Exactly because`Referer`is unreliable,`Origin` was invented. The browser guarantees correct`Origin`for cross-origin requests.
Саме тому, що`Referer`є ненадійним, було винайдено`Origin`. Браузер гарантує правильне`Origin`для запитів між різними джерелами.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
Саме тому, що`Referer` є ненадійним, було винайдено`Origin`. Браузер гарантуєправильне`Origin` для запитів між різними джерелами.
Саме тому, що`Referer` є ненадійним, було винайдено`Origin`. Браузер гарантуєправильний`Origin` для запитів між різними джерелами.

14 changes: 7 additions & 7 deletions5-network/05-fetch-crossorigin/1-do-we-need-origin/task.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,11 +2,11 @@ importance: 5

---

#Why do we need Origin?
#Навіщо нам Origin?

As you probably know, there's HTTP-header `Referer`,that usually contains an url of the page which initiated a network request.
Як ви, мабуть, знаєте, існує HTTP-заголовок `Referer`,який зазвичай містить URL-адресу сторінки, що ініціювала мережевий запит.

For instance, when fetching`http://google.com`from `http://javascript.info/some/url`, the headers look like this:
Наприклад, під час отримання`http://google.com`з `http://javascript.info/some/url` заголовки виглядають так:

```
Accept: */*
Expand All@@ -20,9 +20,9 @@ Referer: http://javascript.info/some/url
*/!*
```

As you can see, both`Referer` and `Origin` are present.
Як бачите, присутні і`Referer`, і `Origin`.

The questions:
Питання:

1.Why`Origin` is needed, if `Referer`has even more information?
2.Is it possible that there's no`Referer`or `Origin`,or is it incorrect?
1.Навіщо потрібен`Origin`, якщо `Referer`містить ще більше інформації?
2.Чи можливо, що немає`Referer`чи `Origin`,або ж це неправильно?
Loading

[8]ページ先頭

©2009-2025 Movatter.jp