freeCodeCamp/curriculum/challenges/italian/09-information-security/information-security-with-h.../prevent-ie-from-opening-unt...

1.7 KiB

id title challengeType forumTopicId dashedName
587d8248367417b2b2512c3b Impedire a IE di aprire HTML non attendibile con helmet.ieNoOpen() 2 301584 prevent-ie-from-opening-untrusted-html-with-helmet-ienoopen

--description--

Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su Replit, o clonato da GitHub.

Alcune applicazioni web serviranno HTML non attendibile per il download. Alcune versioni di Internet Explorer per impostazione predefinita aprono quei file HTML nel contesto del tuo sito. Ciò significa che una pagina HTML non attendibile potrebbe iniziare a fare cose sbagliate nel contesto delle tue pagine. Questo middleware imposta l'intestazione delle Opzioni di X-D a noopen. Questo impedirà agli utenti di IE di eseguire i download nel contesto del sito affidabile.

--instructions--

Usa il metodo helmet.ieNoOpen() sul tuo server.

--hints--

Il middleware helmet.ieNoOpen() deve essere montato correttamente

(getUserInput) =>
  $.get(getUserInput('url') + '/_api/app-info').then(
    (data) => {
      assert.include(data.appStack, 'ienoopen');
      assert.equal(data.headers['x-download-options'], 'noopen');
    },
    (xhr) => {
      throw new Error(xhr.responseText);
    }
  );

--solutions--

/**
  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.
*/