Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/devtools/client/jsonview/test/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 877 B image not shown  

Quelle  json_multipart.sjs   Sprache: unbekannt

 
Untersuchungsergebnis.sjs Download desUnknown {[0] [0] [0]}

"use strict";

const BOUNDARY = "boundary";
const JSON_DATA = `Content-Type: application/vnd.mozilla.json.view

{ "hello": "world" }`;

const HTML = `Content-Type: text/html

<html>
  <body>Test multipart</body>
</html>`;

async function handleRequest(request, response) {
  response.processAsync();

  response.setHeader(
    "Content-Type",
    `multipart/x-mixed-replace; boundary=${BOUNDARY}`,
    false
  );
  response.setStatusLine(request.httpVersion, "200", "OK");

  response.write(`--${BOUNDARY}\n`);
  response.write(`${JSON_DATA}\n`);
  response.write(`--${BOUNDARY}\n`);

  await sleep(1000);

  response.write(`${HTML}\n`);
  response.write(`--${BOUNDARY}--\n`);
  response.finish();
}

function sleep(delay) {
  return new Promise(res =>
    Cc["@mozilla.org/timer;1"]
      .createInstance(Ci.nsITimer)
      .init(res, delay, Ci.nsITimer.TYPE_ONE_SHOT)
  );
}

[Dauer der Verarbeitung: 0.21 Sekunden, vorverarbeitet 2026-08-25]