Co-authored-by: Wocanilo <daniel.sese@wuolah.com> Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
3.6 KiB
3.6 KiB
id, title, challengeType, forumTopicId, localeTitle
id | title | challengeType | forumTopicId | localeTitle |
---|---|---|---|---|
587d8248367417b2b2512c3c | Ask Browsers to Access Your Site via HTTPS Only with helmet.hsts() | 2 | 301573 | Попросите Браузеры получить доступ к вашему сайту через HTTPS Только с помощью helmet.hsts () |
Description
Instructions
helmet.hsts()
to use HTTPS for the next 90 days. Pass the config object {maxAge: timeInMilliseconds, force: true}
. Glitch already has hsts enabled. To override its settings you need to set the field "force" to true in the config object. We will intercept and restore the Glitch header, after inspecting it for testing.
Note: Configuring HTTPS on a custom website requires the acquisition of a domain, and a SSL/TSL Certificate.
Tests
tests:
- text: Средство шлема helmet.hsts () должно быть правильно установлено
testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.include(data.appStack, "hsts"); assert.property(data.headers, "strict-transport-security"); }, xhr => { throw new Error(xhr.responseText); })'
- text: maxAge должно быть равно 7776000 мс (90 дней)
testString: 'getUserInput => $.get(getUserInput("url") + "/_api/app-info").then(data => { assert.match(data.headers["strict-transport-security"], /^max-age=7776000;?/); }, xhr => { throw new Error(xhr.responseText); })'