--description--
As a reminder, this project is being built upon the following starter project on Gitpod, or cloned from GitHub. Browsers can use content or MIME sniffing to override the Content-Type
header of a response to guess and process the data using an implicit content type. While this can be convenient in some scenarios, it can also lead to some dangerous attacks. This middleware sets the X-Content-Type-Options
header to nosniff
, instructing the browser to not bypass the provided Content-Type
.
--instructions--
Use the helmet.noSniff()
method on your server.
--hints--
helmet.noSniff() middleware should be mounted correctly
(getUserInput) =>
$.get(getUserInput('url') + '/_api/app-info').then(
(data) => {
assert.include(data.appStack, 'nosniff');
assert.equal(data.headers['x-content-type-options'], 'nosniff');
},
(xhr) => {
throw new Error(xhr.responseText);
}
);