tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

1xx-response.any.js (1140B)


      1 promise_test(async (t) => {
      2  // The 100 response should be ignored, then the transaction ends, which
      3  // should lead to an error.
      4  await promise_rejects_js(
      5    t, TypeError, fetch('/common/text-plain.txt?pipe=status(100)'));
      6 }, 'Status(100) should be ignored.');
      7 
      8 // This behavior is being discussed at https://github.com/whatwg/fetch/issues/1397.
      9 promise_test(async (t) => {
     10  const res = await fetch('/common/text-plain.txt?pipe=status(101)');
     11  assert_equals(res.status, 101);
     12  const body = await res.text();
     13  assert_equals(body, '');
     14 }, 'Status(101) should be accepted, with removing body.');
     15 
     16 promise_test(async (t) => {
     17  // The 103 response should be ignored, then the transaction ends, which
     18  // should lead to an error.
     19  await promise_rejects_js(
     20     t, TypeError, fetch('/common/text-plain.txt?pipe=status(103)'));
     21 }, 'Status(103) should be ignored.');
     22 
     23 promise_test(async (t) => {
     24  // The 199 response should be ignored, then the transaction ends, which
     25  // should lead to an error.
     26  await promise_rejects_js(
     27    t, TypeError, fetch('/common/text-plain.txt?pipe=status(199)'));
     28 }, 'Status(199) should be ignored.');