Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

1.4 KB
Raw Blame
<!doctype html>
<meta charset="utf-8">
<script src="/wpt/resources/testharness.js"></script>
<script src="/wpt/resources/testharnessreport.js"></script>
<script src="/wpt/resources/moli-wpt-adapter.js"></script>
<script>
promise_test(async function () {
  const setResponse = await fetch("/wpt/runtime/cookies/path-scope/set");
  assert_equals(await setResponse.text(), "path-cookie=set", "setter route response");

  const matching = await fetch("/wpt/runtime/cookies/path-scope/check");
  assert_equals(
    await matching.text(),
    "path-cookie=seen",
    "path-scoped cookie should be included on the matching path boundary",
  );

  const nonMatching = await fetch("/wpt/runtime/cookies/path-scope-extra/check");
  assert_equals(
    await nonMatching.text(),
    "path-cookie=missing",
    "path-scoped cookie should not leak into sibling path prefixes",
  );
}, "HTTP cookies respect valid path boundaries during same-origin fetches");

promise_test(async function () {
  const setResponse = await fetch("/wpt/runtime/cookies/invalid-domain/set");
  assert_equals(await setResponse.text(), "invalid-domain=set", "setter route response");

  const checkResponse = await fetch("/wpt/runtime/cookies/invalid-domain/check");
  assert_equals(
    await checkResponse.text(),
    "invalid-domain=missing",
    "invalid Domain cookies should be rejected before later same-origin fetches",
  );
}, "HTTP cookies reject invalid Domain attributes");
</script>