const formContentTypes = ["application/x-www-form-urlencoded", "multipart/form-data"];
function hasContentType(contentType, expected) {
  const type = contentType.split(";")[0].toLowerCase();
  return expected.some((t) => type === t);
}
function cloneRequestFromConsumedBody(request, consumedBody) {
  if (consumedBody instanceof FormData) {
    request.headers.delete("Content-Type");
  }
  return new Request(request.url, {
    method: request.method,
    headers: request.headers,
    body: consumedBody,
    mode: request.mode,
    credentials: request.credentials,
    cache: request.cache,
    redirect: request.redirect,
    referrer: request.referrer,
    integrity: request.integrity
  });
}
export {
  cloneRequestFromConsumedBody,
  formContentTypes,
  hasContentType
};
