summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/orb/resources/utils.js
blob: 94a2177f0792bb2ecb0230238e0c0dda55215230 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function header(name, value) {
  return `header(${name},${value})`;
}

function contentType(type) {
  return header("Content-Type", type);
}

function contentTypeOptions(type) {
  return header("X-Content-Type-Options", type);
}

function fetchORB(file, options, ...pipe) {
  return fetch(`${file}${pipe.length ? `?pipe=${pipe.join("|")}` : ""}`, {
    ...(options || {}),
    mode: "no-cors",
  });
}