javascript-tutorial / javascript-tutorial/ru.javascript.info
[Баг]:
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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