javascript-tutorial / javascript-tutorial/ru.javascript.info

[Баг]:

Open Beginner friendly
#2,108 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
HTML
Stars
4.1k
Forks
922
PR merge metrics
No merged PRs in 30d

Description

Описание

В статье https://learn.javascript.ru/fetch-api#referrer-referrerpolicy ошибка в том что раньше был другой параметр по-умолчанию no-referrer-when-downgrade https://www.google.com/url?sa=i&source=web&rct=j&url=https://developer.chrome.com/blog/referrer-policy-new-chrome-default%23:~:text%3DUp%2520until%2520recently%252C%2520no%252Dreferrer,larger%2520initiative:%2520the%2520Privacy%2520Sandbox.&ved=2ahUKEwjQ2cH_ybySAxXz4wIHHYmkIL0Q1fkOegYIAQgMEAI&opi=89978449&cd&psig=AOvVaw0Oisvtjz6mNAWVGPKRysDV&ust=1770182545047000
А сейчас strict-origin-when-cross-origin,
Поэтому надо в тексте это упомянуть.
Допустим, у нас есть админка со структурой URL, которая не должна стать известной снаружи сайта.

Если мы отправляем запрос fetch, то по умолчанию он всегда отправляет заголовок Referer с полным URL-адресом нашей админки (исключение – это когда мы делаем запрос от HTTPS в HTTP, в таком случае Referer не будет отправляться).

Например, Referer: https://javascript.info/admin/secret/paths.

Если мы хотим, чтобы другие сайты получали только источник, но не URL-путь, это сделает такая настройка:

fetch('https://another.com/page', {
// ...
referrerPolicy: "origin-when-cross-origin" // Referer: https://javascript.info
});

Как воспроизвести?

Уже описал

Браузер

Любой браузер

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the fetch API article section linked in the issue, especially the referrer/referrerPolicy subsection. Verify the browser default described there against the referenced browser documentation, then update the explanation and example so they match current behavior. Done means the article no longer presents the outdated default as current.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.