{"version":3,"file":"constants.mjs","sources":["../../../../lib/web/fetch/constants.js"],"sourcesContent":["'use strict'\n\nconst corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])\n\nconst redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])\nconst redirectStatusSet = new Set(redirectStatus)\n\n/**\n * @see https://fetch.spec.whatwg.org/#block-bad-port\n */\nconst badPorts = /** @type {const} */ ([\n  '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n  '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n  '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n  '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n  '2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',\n  '6697', '10080'\n])\nconst badPortsSet = new Set(badPorts)\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header\n */\nconst referrerPolicyTokens = /** @type {const} */ ([\n  'no-referrer',\n  'no-referrer-when-downgrade',\n  'same-origin',\n  'origin',\n  'strict-origin',\n  'origin-when-cross-origin',\n  'strict-origin-when-cross-origin',\n  'unsafe-url'\n])\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\n */\nconst referrerPolicy = /** @type {const} */ ([\n  '',\n  ...referrerPolicyTokens\n])\nconst referrerPolicyTokensSet = new Set(referrerPolicyTokens)\n\nconst requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])\n\nconst safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE', 'QUERY'])\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])\n\nconst requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])\n\nconst requestCache = /** @type {const} */ ([\n  'default',\n  'no-store',\n  'reload',\n  'no-cache',\n  'force-cache',\n  'only-if-cached'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#request-body-header-name\n */\nconst requestBodyHeader = /** @type {const} */ ([\n  'content-encoding',\n  'content-language',\n  'content-location',\n  'content-type',\n  // See https://github.com/nodejs/undici/issues/2021\n  // 'Content-Length' is a forbidden header name, which is typically\n  // removed in the Headers implementation. However, undici doesn't\n  // filter out headers, so we add it here.\n  'content-length'\n])\n\n/**\n * @see https://fetch.spec.whatwg.org/#enumdef-requestduplex\n */\nconst requestDuplex = /** @type {const} */ ([\n  'half'\n])\n\n/**\n * @see http://fetch.spec.whatwg.org/#forbidden-method\n */\nconst forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = /** @type {const} */ ([\n  'audio',\n  'audioworklet',\n  'font',\n  'image',\n  'manifest',\n  'paintworklet',\n  'script',\n  'style',\n  'track',\n  'video',\n  'xslt',\n  ''\n])\nconst subresourceSet = new Set(subresource)\n\nmodule.exports = {\n  subresource,\n  forbiddenMethods,\n  requestBodyHeader,\n  referrerPolicy,\n  requestRedirect,\n  requestMode,\n  requestCredentials,\n  requestCache,\n  redirectStatus,\n  corsSafeListedMethods,\n  nullBodyStatus,\n  safeMethods,\n  badPorts,\n  requestDuplex,\n  subresourceSet,\n  badPortsSet,\n  redirectStatusSet,\n  corsSafeListedMethodsSet,\n  safeMethodsSet,\n  forbiddenMethodsSet,\n  referrerPolicyTokens: referrerPolicyTokensSet\n}\n"],"names":["corsSafeListedMethods","corsSafeListedMethodsSet","Set","redirectStatus","redirectStatusSet","badPorts","badPortsSet","referrerPolicyTokens","referrerPolicy","referrerPolicyTokensSet","safeMethods","safeMethodsSet","forbiddenMethods","forbiddenMethodsSet","subresource","subresourceSet","constants","requestBodyHeader","requestRedirect","requestMode","requestCredentials","requestCache","nullBodyStatus","requestDuplex"],"mappings":"+HAEA,MAAMA,0CAAqB,CAA0B,MAAO,OAAQ,QAC9DC,yBAA2B,IAAIC,IAAIF,uBAInCG,mCAAc,CAA0B,IAAK,IAAK,IAAK,IAAK,KAC5DC,kBAAoB,IAAIF,IAAIC,gBAK5BE,6BAAQ,CACZ,IAAK,IAAK,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAC/G,KAAM,KAAM,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MACvG,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAClG,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAAQ,OAAQ,OACpG,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OACxG,OAAQ,SAEJC,YAAc,IAAIJ,IAAIG,UAKtBE,yCAAoB,CACxB,cACA,6BACA,cACA,SACA,gBACA,2BACA,kCACA,cAMIC,mCAAc,CAClB,MACGD,sBAECE,wBAA0B,IAAIP,IAAIK,sBAIlCG,gCAAW,CAA0B,MAAO,OAAQ,UAAW,QAAS,SACxEC,eAAiB,IAAIT,IAAIQ,aAwCzBE,qCAAgB,CAA0B,UAAW,QAAS,SAC9DC,oBAAsB,IAAIX,IAAIU,kBAE9BE,gCAAW,CACf,QACA,eACA,OACA,QACA,WACA,eACA,SACA,QACA,QACA,QACA,OACA,IAEIC,eAAiB,IAAIb,IAAIY,oBAE/BE,UAAiB,CACfF,YACAF,iBACAK,sCA5CqB,CACrB,mBACA,mBACA,mBACA;;;;;AAKA,kBAoCAT,eACAU,oCAnEmB,CAA0B,SAAU,SAAU,SAoEjEC,gCA/De,CAA0B,WAAY,cAAe,UAAW,QAgE/EC,uCA9DsB,CAA0B,OAAQ,cAAe,WA+DvEC,iCA7DgB,CAChB,UACA,WACA,SACA,WACA,cACA,kBAwDAlB,eACAH,sBACAsB,mCAlHkB,CAA0B,IAAK,IAAK,IAAK,KAmH3DZ,YACAL,SACAkB,kCAxCiB,CACjB,QAwCAR,eACAT,YACAF,kBACAH,yBACAU,eACAE,oBACAN,qBAAsBE"}