Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/xhr/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  cors-upload.any.js

  Sprache: JAVA
 

// META: title=Cross-Origin POST with preflight and FormData body should send body
// META: script=/common/get-host-info.sub.js
"use strict";

function testCorsFormDataUpload(description, path, method, form, headers, withCredentials) {
  const test = async_test(description);
  const client = new XMLHttpRequest();
  const url = corsURL(path);

  client.open(method, url, true);
  client.withCredentials = withCredentials;
  for (const key of Object.keys(headers)) {
    client.setRequestHeader(key, headers[key]);
  }

  client.send(form);

  client.onload = () => {
    test.step(() => {
      assert_equals(client.status, 200);
      assert_regexp_match(client.responseText, /Content-Disposition: form-data/);

      for (const key of form.keys()) {
        assert_regexp_match(client.responseText, new RegExp(key));
        assert_regexp_match(client.responseText, new RegExp(form.get(key)));
      }
    });
    test.done();
  };
}

function corsURL(path) {
  const url = new URL(path, location.href);
  url.hostname = get_host_info().REMOTE_HOST;
  return url.href;
}

const form = new FormData();
form.append("key""value");

testCorsFormDataUpload(
  "Cross-Origin POST FormData body but no preflight",
  "resources/echo-content-cors.py",
  "POST",
  form,
  {},
  false
);

testCorsFormDataUpload(
  "Cross-Origin POST with preflight and FormData body",
  "resources/echo-content-cors.py",
  "POST",
  form,
  {
    Authorization: "Bearer access-token"
  },
  true
);

Messung V0.5 in Prozent
C=89 H=90 G=89

¤ Dauer der Verarbeitung: 0.26 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.