Files
freeCodeCamp/curriculum/challenges/ukrainian/09-information-security/information-security-with-helmetjs/hide-potentially-dangerous-information-using-helmet.hidepoweredby.md

41 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

---
id: 587d8247367417b2b2512c37
title: Приховування потенційно небезпечної інформації за допомогою helmet.hidePoweredBy()
challengeType: 2
forumTopicId: 301580
dashedName: hide-potentially-dangerous-information-using-helmet-hidepoweredby
---
# --description--
Нагадуємо, що цей проект створюється на основі наступного початкового проекту [Replit](https://replit.com/github/freeCodeCamp/boilerplate-infosec) або копіюється з [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/).
Хакери можуть використовувати наявні недоліки в системі захисту в Express/Node, якщо вони бачать, що сайт працює на базі Express. Тег `X-Powered-By: Express` надсилається в кожен запит, що надійшов з Express за замовчуванням. Використовуйте проміжне програмне забезпечення `helmet.hidePoweredBy()`, щоб усунути заголовок X-Powered-By.
# --hints--
проміжне програмне забезпечення helmet.hidePoweredBy() необхідно правильно встановити
```js
(getUserInput) =>
$.get(getUserInput('url') + '/_api/app-info').then(
(data) => {
assert.include(data.appStack, 'hidePoweredBy');
assert.notEqual(data.headers['x-powered-by'], 'Express');
},
(xhr) => {
throw new Error(xhr.responseText);
}
);
```
# --solutions--
```js
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
```