@utilix-tech/sdk 0.53.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +21 -4
- package/dist/{chunk-Y7YY733Z.js → chunk-DEBIH7QS.js} +58 -1
- package/dist/{chunk-K4ZERKBD.js → chunk-JW4NG2GN.js} +119 -1
- package/dist/{code-B_gDkRAx.d.cts → code-rxidGgvB.d.cts} +28 -2
- package/dist/{code-B_gDkRAx.d.ts → code-rxidGgvB.d.ts} +28 -2
- package/dist/index.cjs +175 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{network-DelcJeJa.d.cts → network-C6IcHeMB.d.cts} +51 -2
- package/dist/{network-DelcJeJa.d.ts → network-C6IcHeMB.d.ts} +51 -2
- package/dist/tools/code.cjs +118 -0
- package/dist/tools/code.d.cts +1 -1
- package/dist/tools/code.d.ts +1 -1
- package/dist/tools/code.js +1 -1
- package/dist/tools/network.cjs +57 -0
- package/dist/tools/network.d.cts +1 -1
- package/dist/tools/network.d.ts +1 -1
- package/dist/tools/network.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10507,7 +10507,9 @@ __export(network_exports, {
|
|
|
10507
10507
|
PERMISSIONS_POLICY_FEATURES: () => PERMISSIONS_POLICY_FEATURES,
|
|
10508
10508
|
REFERRER_POLICY_VALUES: () => REFERRER_POLICY_VALUES,
|
|
10509
10509
|
STATUS_CODES: () => STATUS_CODES,
|
|
10510
|
+
X_CONTENT_TYPE_OPTIONS_HEADER: () => X_CONTENT_TYPE_OPTIONS_HEADER,
|
|
10510
10511
|
analyzeEmailHeaders: () => analyzeEmailHeaders,
|
|
10512
|
+
assessContentTypeRisk: () => assessContentTypeRisk,
|
|
10511
10513
|
buildCacheControl: () => buildCacheControl,
|
|
10512
10514
|
buildClientHints: () => buildClientHints,
|
|
10513
10515
|
buildContentDisposition: () => buildContentDisposition,
|
|
@@ -10519,6 +10521,7 @@ __export(network_exports, {
|
|
|
10519
10521
|
buildRangeHeader: () => buildRangeHeader,
|
|
10520
10522
|
buildReferrerPolicy: () => buildReferrerPolicy,
|
|
10521
10523
|
buildVaryHeader: () => buildVaryHeader,
|
|
10524
|
+
buildXContentTypeOptionsHeader: () => buildXContentTypeOptionsHeader,
|
|
10522
10525
|
checkSetCookieHeader: () => checkSetCookieHeader,
|
|
10523
10526
|
countryCodeToFlag: () => countryCodeToFlag,
|
|
10524
10527
|
formatCoordinates: () => formatCoordinates,
|
|
@@ -10544,6 +10547,7 @@ __export(network_exports, {
|
|
|
10544
10547
|
parsePermissionsPolicy: () => parsePermissionsPolicy,
|
|
10545
10548
|
parseUserAgent: () => parseUserAgent,
|
|
10546
10549
|
parseVaryHeader: () => parseVaryHeader,
|
|
10550
|
+
parseXContentTypeOptionsHeader: () => parseXContentTypeOptionsHeader,
|
|
10547
10551
|
searchHeaders: () => searchHeaders,
|
|
10548
10552
|
searchStatusCodes: () => searchStatusCodes,
|
|
10549
10553
|
splitSitemap: () => splitSitemap,
|
|
@@ -13272,6 +13276,59 @@ function parseContentDisposition(header) {
|
|
|
13272
13276
|
}
|
|
13273
13277
|
return { type, filename, filenameIsExtended, params };
|
|
13274
13278
|
}
|
|
13279
|
+
var X_CONTENT_TYPE_OPTIONS_HEADER = "X-Content-Type-Options: nosniff";
|
|
13280
|
+
function buildXContentTypeOptionsHeader() {
|
|
13281
|
+
return {
|
|
13282
|
+
header: X_CONTENT_TYPE_OPTIONS_HEADER,
|
|
13283
|
+
value: "nosniff",
|
|
13284
|
+
explanation: `Tells the browser to strictly honor the declared Content-Type header instead of "sniffing" a response's bytes to guess its real type. Without it, a browser that decides an oddly-typed response looks like HTML or JavaScript may render or execute it, letting a file that was only ever meant to be downloaded or displayed as plain text be used to run a cross-site scripting attack.`
|
|
13285
|
+
};
|
|
13286
|
+
}
|
|
13287
|
+
function parseXContentTypeOptionsHeader(rawHeader) {
|
|
13288
|
+
if (typeof rawHeader !== "string" || rawHeader.trim() === "") return { error: "Provide a header line or value to check" };
|
|
13289
|
+
const withoutLabel = rawHeader.trim().replace(/^x-content-type-options\s*:\s*/i, "");
|
|
13290
|
+
const value = withoutLabel.trim();
|
|
13291
|
+
if (value.toLowerCase() === "nosniff") {
|
|
13292
|
+
return { raw: value, valid: true, message: "Valid. The browser will not MIME-sniff this response." };
|
|
13293
|
+
}
|
|
13294
|
+
if (value === "") {
|
|
13295
|
+
return { error: 'No value found after "X-Content-Type-Options:"' };
|
|
13296
|
+
}
|
|
13297
|
+
return { raw: value, valid: false, message: `"${value}" is not a recognized value. The only value browsers act on is "nosniff" (case-insensitive); anything else is silently ignored, same as omitting the header.` };
|
|
13298
|
+
}
|
|
13299
|
+
var X_CONTENT_TYPE_EXACT_RISK_TABLE = {
|
|
13300
|
+
"text/plain": { risk: "high", reason: "Browsers historically sniff text/plain responses and may render them as HTML if the body looks like markup, letting user-controlled text (comments, error pages, logs) execute as script." },
|
|
13301
|
+
"application/octet-stream": { risk: "high", reason: "A generic fallback type with no format hint, so browsers are the most likely to sniff its real content and may render it as HTML." },
|
|
13302
|
+
"": { risk: "high", reason: "A missing Content-Type header gives the browser nothing to trust, so it falls back to sniffing the response body entirely." }
|
|
13303
|
+
};
|
|
13304
|
+
var X_CONTENT_TYPE_PREFIX_RISK_TABLE = [
|
|
13305
|
+
{ prefix: "text/html", risk: "medium", reason: "Already interpreted as HTML, so sniffing mostly matters if the type is wrong on purpose; nosniff still protects against a mismatched charset or embedded polyglot content." },
|
|
13306
|
+
{ prefix: "image/", risk: "low", reason: 'Browsers rarely upgrade an image response to HTML, but a crafted "GIFAR"-style polyglot file can still be sniffed as HTML in older engines.' },
|
|
13307
|
+
{ prefix: "audio/", risk: "low", reason: "Media types are rarely reinterpreted as HTML by modern sniffing algorithms." },
|
|
13308
|
+
{ prefix: "video/", risk: "low", reason: "Media types are rarely reinterpreted as HTML by modern sniffing algorithms." },
|
|
13309
|
+
{ prefix: "font/", risk: "low", reason: "Font types are rarely reinterpreted as HTML by modern sniffing algorithms." },
|
|
13310
|
+
{ prefix: "application/pdf", risk: "low", reason: "PDF has a strong magic-number signature, so sniffing rarely reclassifies it, though nosniff is still worth setting for user-uploaded PDFs." },
|
|
13311
|
+
{ prefix: "application/json", risk: "medium", reason: "Structurally distinct from HTML, but user-controlled JSONP-style responses served with a wrong or missing type have been used in real sniffing attacks." },
|
|
13312
|
+
{ prefix: "application/javascript", risk: "medium", reason: "Already executable; nosniff mainly protects against it being served where a script tag was not expected, such as inside an <img> or <object> tag." },
|
|
13313
|
+
{ prefix: "application/xml", risk: "medium", reason: "XML can be reinterpreted in ways that overlap with HTML/XHTML parsing in some legacy sniffing paths." }
|
|
13314
|
+
];
|
|
13315
|
+
function assessContentTypeRisk(contentType) {
|
|
13316
|
+
if (typeof contentType !== "string") return { error: "contentType must be a string" };
|
|
13317
|
+
const normalized = contentType.trim().toLowerCase().split(";")[0].trim();
|
|
13318
|
+
if (normalized in X_CONTENT_TYPE_EXACT_RISK_TABLE) {
|
|
13319
|
+
const entry = X_CONTENT_TYPE_EXACT_RISK_TABLE[normalized];
|
|
13320
|
+
return { contentType: contentType.trim() || "(empty)", risk: entry.risk, reason: entry.reason };
|
|
13321
|
+
}
|
|
13322
|
+
const prefixMatch = X_CONTENT_TYPE_PREFIX_RISK_TABLE.find((e) => normalized.startsWith(e.prefix));
|
|
13323
|
+
if (prefixMatch) {
|
|
13324
|
+
return { contentType: contentType.trim(), risk: prefixMatch.risk, reason: prefixMatch.reason };
|
|
13325
|
+
}
|
|
13326
|
+
return {
|
|
13327
|
+
contentType: contentType.trim(),
|
|
13328
|
+
risk: "medium",
|
|
13329
|
+
reason: "Not a well-known type in this tool's lookup table. Treat any response type as sniffable unless you've confirmed the serving browser trusts it, and set nosniff regardless of type as a baseline defense."
|
|
13330
|
+
};
|
|
13331
|
+
}
|
|
13275
13332
|
|
|
13276
13333
|
// src/tools/api.ts
|
|
13277
13334
|
var api_exports = {};
|
|
@@ -14637,6 +14694,7 @@ __export(code_exports, {
|
|
|
14637
14694
|
testRegex: () => testRegex,
|
|
14638
14695
|
validateEditorConfig: () => validateEditorConfig,
|
|
14639
14696
|
validateEnvKey: () => validateEnvKey2,
|
|
14697
|
+
validatePackageExports: () => validatePackageExports,
|
|
14640
14698
|
validateTsconfig: () => validateTsconfig
|
|
14641
14699
|
});
|
|
14642
14700
|
var ALL_FLAGS = ["g", "i", "m", "s", "u"];
|
|
@@ -17856,6 +17914,123 @@ function validateTsconfig(text) {
|
|
|
17856
17914
|
const valid = !issues.some((i) => i.severity === "error");
|
|
17857
17915
|
return { parsed: true, topLevelKeys, compilerOptionKeys, issues, valid };
|
|
17858
17916
|
}
|
|
17917
|
+
function collectExportsStringLeaves(value, out = []) {
|
|
17918
|
+
if (typeof value === "string") out.push(value);
|
|
17919
|
+
else if (Array.isArray(value)) value.forEach((v) => collectExportsStringLeaves(v, out));
|
|
17920
|
+
else if (value && typeof value === "object") Object.values(value).forEach((v) => collectExportsStringLeaves(v, out));
|
|
17921
|
+
return out;
|
|
17922
|
+
}
|
|
17923
|
+
function checkExportsPatternMatch(key, value, path, issues) {
|
|
17924
|
+
const keyHasStar = key.includes("*");
|
|
17925
|
+
const leaves = collectExportsStringLeaves(value);
|
|
17926
|
+
if (keyHasStar) {
|
|
17927
|
+
const bad = leaves.filter((l) => !l.includes("*"));
|
|
17928
|
+
if (bad.length > 0) {
|
|
17929
|
+
issues.push({ severity: "error", path, message: `pattern key "${key}" contains "*" but target ${bad.map((l) => `"${l}"`).join(", ")} has no "*" to receive the matched text` });
|
|
17930
|
+
}
|
|
17931
|
+
} else {
|
|
17932
|
+
const bad = leaves.filter((l) => l.includes("*"));
|
|
17933
|
+
if (bad.length > 0) {
|
|
17934
|
+
issues.push({ severity: "error", path, message: `target ${bad.map((l) => `"${l}"`).join(", ")} contains "*" but key "${key}" has no "*" pattern to match against` });
|
|
17935
|
+
}
|
|
17936
|
+
}
|
|
17937
|
+
}
|
|
17938
|
+
function validateExportsValue(value, path, issues) {
|
|
17939
|
+
if (value === null) return;
|
|
17940
|
+
if (typeof value === "string") {
|
|
17941
|
+
if (!value.startsWith("./")) {
|
|
17942
|
+
issues.push({ severity: "error", path, message: `target "${value}" must start with "./"` });
|
|
17943
|
+
}
|
|
17944
|
+
return;
|
|
17945
|
+
}
|
|
17946
|
+
if (Array.isArray(value)) {
|
|
17947
|
+
if (value.length === 0) {
|
|
17948
|
+
issues.push({ severity: "warning", path, message: "empty fallback array will never resolve" });
|
|
17949
|
+
}
|
|
17950
|
+
value.forEach((v, i) => validateExportsValue(v, `${path}[${i}]`, issues));
|
|
17951
|
+
return;
|
|
17952
|
+
}
|
|
17953
|
+
if (typeof value === "object") {
|
|
17954
|
+
const obj = value;
|
|
17955
|
+
const keys = Object.keys(obj);
|
|
17956
|
+
if (keys.length === 0) {
|
|
17957
|
+
issues.push({ severity: "warning", path, message: "empty object will never resolve" });
|
|
17958
|
+
return;
|
|
17959
|
+
}
|
|
17960
|
+
const hasDotKeys = keys.some((k) => k.startsWith("."));
|
|
17961
|
+
const hasNonDotKeys = keys.some((k) => !k.startsWith("."));
|
|
17962
|
+
if (hasDotKeys && hasNonDotKeys) {
|
|
17963
|
+
issues.push({ severity: "error", path, message: 'cannot mix subpath keys (starting with ".") with condition keys in the same object' });
|
|
17964
|
+
return;
|
|
17965
|
+
}
|
|
17966
|
+
if (hasDotKeys) {
|
|
17967
|
+
for (const key of keys) {
|
|
17968
|
+
const subpath = `${path}["${key}"]`;
|
|
17969
|
+
if (key !== "." && !key.startsWith("./")) {
|
|
17970
|
+
issues.push({ severity: "error", path: subpath, message: `subpath key "${key}" must be "." or start with "./"` });
|
|
17971
|
+
}
|
|
17972
|
+
checkExportsPatternMatch(key, obj[key], subpath, issues);
|
|
17973
|
+
validateExportsValue(obj[key], subpath, issues);
|
|
17974
|
+
}
|
|
17975
|
+
return;
|
|
17976
|
+
}
|
|
17977
|
+
if (keys.includes("types") && keys[0] !== "types") {
|
|
17978
|
+
issues.push({ severity: "warning", path, message: '"types" condition should be listed first so TypeScript resolves it before any other condition matches' });
|
|
17979
|
+
}
|
|
17980
|
+
if (keys.includes("default") && keys[keys.length - 1] !== "default") {
|
|
17981
|
+
issues.push({ severity: "warning", path, message: '"default" condition should be listed last; conditions are matched in order and anything after "default" is unreachable' });
|
|
17982
|
+
}
|
|
17983
|
+
if ((keys.includes("import") || keys.includes("require")) && !keys.includes("default")) {
|
|
17984
|
+
issues.push({ severity: "warning", path, message: 'no "default" fallback condition; resolution fails for any importer using a condition not listed here' });
|
|
17985
|
+
}
|
|
17986
|
+
const requireVal = obj.require;
|
|
17987
|
+
if (typeof requireVal === "string" && requireVal.endsWith(".mjs")) {
|
|
17988
|
+
issues.push({ severity: "error", path: `${path}.require`, message: `"require" condition points to a .mjs file ("${requireVal}"), but .mjs is always treated as ESM and cannot be required` });
|
|
17989
|
+
}
|
|
17990
|
+
const importVal = obj.import;
|
|
17991
|
+
if (typeof importVal === "string" && importVal.endsWith(".cjs")) {
|
|
17992
|
+
issues.push({ severity: "error", path: `${path}.import`, message: `"import" condition points to a .cjs file ("${importVal}"), but .cjs is always treated as CommonJS and cannot be imported as ESM` });
|
|
17993
|
+
}
|
|
17994
|
+
for (const key of keys) {
|
|
17995
|
+
validateExportsValue(obj[key], `${path}.${key}`, issues);
|
|
17996
|
+
}
|
|
17997
|
+
return;
|
|
17998
|
+
}
|
|
17999
|
+
issues.push({ severity: "error", path, message: `unexpected value type at "${path}"` });
|
|
18000
|
+
}
|
|
18001
|
+
function validatePackageExports(packageJsonText) {
|
|
18002
|
+
if (!packageJsonText || !packageJsonText.trim()) return { error: "Input is empty" };
|
|
18003
|
+
let parsed;
|
|
18004
|
+
try {
|
|
18005
|
+
parsed = JSON.parse(packageJsonText);
|
|
18006
|
+
} catch (e) {
|
|
18007
|
+
return { error: `Invalid JSON: ${e.message}` };
|
|
18008
|
+
}
|
|
18009
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
18010
|
+
return { error: "Root of package.json must be an object" };
|
|
18011
|
+
}
|
|
18012
|
+
const obj = parsed;
|
|
18013
|
+
if (!("exports" in obj)) return { error: 'package.json has no "exports" field' };
|
|
18014
|
+
const exportsValue = obj.exports;
|
|
18015
|
+
const issues = [];
|
|
18016
|
+
let exportsShape;
|
|
18017
|
+
if (exportsValue === null) {
|
|
18018
|
+
exportsShape = "null";
|
|
18019
|
+
} else if (typeof exportsValue === "string") {
|
|
18020
|
+
exportsShape = "string";
|
|
18021
|
+
} else if (Array.isArray(exportsValue)) {
|
|
18022
|
+
exportsShape = "array";
|
|
18023
|
+
} else if (typeof exportsValue === "object") {
|
|
18024
|
+
const keys = Object.keys(exportsValue);
|
|
18025
|
+
exportsShape = keys.some((k) => k.startsWith(".")) ? "subpaths" : "conditions";
|
|
18026
|
+
} else {
|
|
18027
|
+
return { error: '"exports" must be a string, array, object, or null' };
|
|
18028
|
+
}
|
|
18029
|
+
validateExportsValue(exportsValue, "exports", issues);
|
|
18030
|
+
const subpaths = exportsShape === "subpaths" ? Object.keys(exportsValue) : ["."];
|
|
18031
|
+
const valid = !issues.some((i) => i.severity === "error");
|
|
18032
|
+
return { parsed: true, exportsShape, subpaths, issues, valid };
|
|
18033
|
+
}
|
|
17859
18034
|
|
|
17860
18035
|
// src/tools/color.ts
|
|
17861
18036
|
var color_exports = {};
|
package/dist/index.d.cts
CHANGED
|
@@ -6,9 +6,9 @@ export { d as data } from './data-CupeugaR.cjs';
|
|
|
6
6
|
export { g as generators } from './generators-Du8cBesn.cjs';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.cjs';
|
|
8
8
|
export { u as units } from './units-p-1Ikx7l.cjs';
|
|
9
|
-
export { n as network } from './network-
|
|
9
|
+
export { n as network } from './network-C6IcHeMB.cjs';
|
|
10
10
|
export { a as api } from './api-DmTNE4c1.cjs';
|
|
11
|
-
export { c as code } from './code-
|
|
11
|
+
export { c as code } from './code-rxidGgvB.cjs';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.cjs';
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.cjs';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ export { d as data } from './data-CupeugaR.js';
|
|
|
6
6
|
export { g as generators } from './generators-Du8cBesn.js';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.js';
|
|
8
8
|
export { u as units } from './units-p-1Ikx7l.js';
|
|
9
|
-
export { n as network } from './network-
|
|
9
|
+
export { n as network } from './network-C6IcHeMB.js';
|
|
10
10
|
export { a as api } from './api-DmTNE4c1.js';
|
|
11
|
-
export { c as code } from './code-
|
|
11
|
+
export { c as code } from './code-rxidGgvB.js';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.js';
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.js';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { media_exports as media } from './chunk-226EH3ZI.js';
|
|
2
2
|
export { units_exports as units } from './chunk-NKN656TQ.js';
|
|
3
|
-
export { network_exports as network } from './chunk-
|
|
3
|
+
export { network_exports as network } from './chunk-DEBIH7QS.js';
|
|
4
4
|
export { api_exports as api } from './chunk-52ZDKSIX.js';
|
|
5
|
-
export { code_exports as code } from './chunk-
|
|
5
|
+
export { code_exports as code } from './chunk-JW4NG2GN.js';
|
|
6
6
|
export { color_exports as color } from './chunk-BPVAB4P2.js';
|
|
7
7
|
export { css_exports as css } from './chunk-6YPV2AB5.js';
|
|
8
8
|
export { misc_exports as misc } from './chunk-GX7H6TAX.js';
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
|
|
22
22
|
* - vary-header-builder: buildVaryHeader, parseVaryHeader
|
|
23
23
|
* - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
|
|
24
|
+
* - x-content-type-options-builder: buildXContentTypeOptionsHeader, parseXContentTypeOptionsHeader, assessContentTypeRisk
|
|
24
25
|
*/
|
|
25
26
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
26
27
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -702,6 +703,46 @@ declare function buildContentDisposition(options?: ContentDispositionBuildOption
|
|
|
702
703
|
declare function parseContentDisposition(header: string): ContentDispositionParseResult | {
|
|
703
704
|
error: string;
|
|
704
705
|
};
|
|
706
|
+
declare const X_CONTENT_TYPE_OPTIONS_HEADER = "X-Content-Type-Options: nosniff";
|
|
707
|
+
interface XContentTypeOptionsHeader {
|
|
708
|
+
header: string;
|
|
709
|
+
value: 'nosniff';
|
|
710
|
+
explanation: string;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Build the X-Content-Type-Options header. There is only one valid value,
|
|
714
|
+
* so this simply returns the fixed header plus a plain-English explanation
|
|
715
|
+
* of the MIME-sniffing attack it prevents.
|
|
716
|
+
*/
|
|
717
|
+
declare function buildXContentTypeOptionsHeader(): XContentTypeOptionsHeader;
|
|
718
|
+
interface XContentTypeOptionsParseResult {
|
|
719
|
+
raw: string;
|
|
720
|
+
valid: boolean;
|
|
721
|
+
message: string;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Validate a pasted X-Content-Type-Options header value. The header only
|
|
725
|
+
* has one correct value ("nosniff"); anything else is either a typo or a
|
|
726
|
+
* no-op the browser ignores.
|
|
727
|
+
*/
|
|
728
|
+
declare function parseXContentTypeOptionsHeader(rawHeader: string): XContentTypeOptionsParseResult | {
|
|
729
|
+
error: string;
|
|
730
|
+
};
|
|
731
|
+
type ContentTypeSniffRisk = 'high' | 'medium' | 'low';
|
|
732
|
+
interface ContentTypeRiskResult {
|
|
733
|
+
contentType: string;
|
|
734
|
+
risk: ContentTypeSniffRisk;
|
|
735
|
+
reason: string;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Assess how risky it is to serve a given Content-Type without the
|
|
739
|
+
* X-Content-Type-Options: nosniff header, based on well-known MIME-sniffing
|
|
740
|
+
* attack surfaces. This is a heuristic classification, not a security scan
|
|
741
|
+
* of an actual response.
|
|
742
|
+
*/
|
|
743
|
+
declare function assessContentTypeRisk(contentType: string): ContentTypeRiskResult | {
|
|
744
|
+
error: string;
|
|
745
|
+
};
|
|
705
746
|
|
|
706
747
|
type network_AuthResultEntry = AuthResultEntry;
|
|
707
748
|
type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
|
|
@@ -717,6 +758,8 @@ type network_ContentDispositionBuildOptions = ContentDispositionBuildOptions;
|
|
|
717
758
|
type network_ContentDispositionBuildResult = ContentDispositionBuildResult;
|
|
718
759
|
type network_ContentDispositionParseResult = ContentDispositionParseResult;
|
|
719
760
|
type network_ContentRangeResult = ContentRangeResult;
|
|
761
|
+
type network_ContentTypeRiskResult = ContentTypeRiskResult;
|
|
762
|
+
type network_ContentTypeSniffRisk = ContentTypeSniffRisk;
|
|
720
763
|
type network_CookieAttributes = CookieAttributes;
|
|
721
764
|
type network_CookieCheckResult = CookieCheckResult;
|
|
722
765
|
declare const network_DNS_RECORD_TYPES: typeof DNS_RECORD_TYPES;
|
|
@@ -775,7 +818,11 @@ type network_UaDeviceType = UaDeviceType;
|
|
|
775
818
|
type network_UserAgentInfo = UserAgentInfo;
|
|
776
819
|
type network_VaryHeaderEntry = VaryHeaderEntry;
|
|
777
820
|
type network_VaryHeaderResult = VaryHeaderResult;
|
|
821
|
+
type network_XContentTypeOptionsHeader = XContentTypeOptionsHeader;
|
|
822
|
+
type network_XContentTypeOptionsParseResult = XContentTypeOptionsParseResult;
|
|
823
|
+
declare const network_X_CONTENT_TYPE_OPTIONS_HEADER: typeof X_CONTENT_TYPE_OPTIONS_HEADER;
|
|
778
824
|
declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
|
|
825
|
+
declare const network_assessContentTypeRisk: typeof assessContentTypeRisk;
|
|
779
826
|
declare const network_buildCacheControl: typeof buildCacheControl;
|
|
780
827
|
declare const network_buildClientHints: typeof buildClientHints;
|
|
781
828
|
declare const network_buildContentDisposition: typeof buildContentDisposition;
|
|
@@ -787,6 +834,7 @@ declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
|
|
|
787
834
|
declare const network_buildRangeHeader: typeof buildRangeHeader;
|
|
788
835
|
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
789
836
|
declare const network_buildVaryHeader: typeof buildVaryHeader;
|
|
837
|
+
declare const network_buildXContentTypeOptionsHeader: typeof buildXContentTypeOptionsHeader;
|
|
790
838
|
declare const network_checkSetCookieHeader: typeof checkSetCookieHeader;
|
|
791
839
|
declare const network_countryCodeToFlag: typeof countryCodeToFlag;
|
|
792
840
|
declare const network_formatCoordinates: typeof formatCoordinates;
|
|
@@ -812,6 +860,7 @@ declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
|
812
860
|
declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
|
|
813
861
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
814
862
|
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
863
|
+
declare const network_parseXContentTypeOptionsHeader: typeof parseXContentTypeOptionsHeader;
|
|
815
864
|
declare const network_searchHeaders: typeof searchHeaders;
|
|
816
865
|
declare const network_searchStatusCodes: typeof searchStatusCodes;
|
|
817
866
|
declare const network_splitSitemap: typeof splitSitemap;
|
|
@@ -824,7 +873,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
824
873
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
825
874
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
826
875
|
declare namespace network {
|
|
827
|
-
export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
876
|
+
export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
828
877
|
}
|
|
829
878
|
|
|
830
|
-
export { type
|
|
879
|
+
export { type ReceivedHop as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type LinkHeaderEntry as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type LinkHeaderEntryInput as J, type LinkHeaderResult as K, LINK_REL_VALUES as L, type LinkRel as M, type ManifestIconInfo as N, type ManifestIssue as O, type ManifestValidationResult as P, PERMISSIONS_POLICY_FEATURES as Q, type ParsedClientHint as R, type ParsedDnsResult as S, type ParsedGeoResult as T, type PermissionsPolicyDirective as U, type PermissionsPolicyFeatureInput as V, type PermissionsPolicyResult as W, REFERRER_POLICY_VALUES as X, type RangeEntry as Y, type RangeEntryInput as Z, type RangeHeaderResult as _, type CacheControlDirective as a, parseXContentTypeOptionsHeader as a$, type ReferrerPolicyEntry as a0, type ReferrerPolicyResult as a1, type ReferrerPolicyValue as a2, type RobotsGroup as a3, type RobotsIssue as a4, type RobotsRule as a5, type RobotsValidationResult as a6, STATUS_CODES as a7, type SameSiteValue as a8, type SitemapIndexEntry as a9, buildVaryHeader as aA, buildXContentTypeOptionsHeader as aB, checkSetCookieHeader as aC, countryCodeToFlag as aD, formatCoordinates as aE, formatTtl as aF, getByCategory as aG, getHeader as aH, getHeadersByCategory as aI, getStatusByCategory as aJ, getStatusCode as aK, isClientError as aL, isServerError as aM, isSuccess as aN, isValidIp as aO, isValidIpv4 as aP, isValidIpv6 as aQ, parseClientHintHeaders as aR, parseContentDisposition as aS, parseContentRangeHeader as aT, parseDnsResponse as aU, parseGeoResponse as aV, parseHar as aW, parseIpv6Address as aX, parsePermissionsPolicy as aY, parseUserAgent as aZ, parseVaryHeader as a_, type SitemapIssue as aa, type SitemapSplitFile as ab, type SitemapUrlEntry as ac, type SitemapValidationResult as ad, type SplitSitemapOptions as ae, type SplitSitemapResult as af, type StatusCode as ag, type UaDeviceType as ah, type UserAgentInfo as ai, type VaryHeaderEntry as aj, type VaryHeaderResult as ak, type XContentTypeOptionsHeader as al, type XContentTypeOptionsParseResult as am, X_CONTENT_TYPE_OPTIONS_HEADER as an, analyzeEmailHeaders as ao, assessContentTypeRisk as ap, buildCacheControl as aq, buildClientHints as ar, buildContentDisposition as as, buildDnsQueryUrl as at, buildGeoUrl as au, buildLinkHeader as av, buildMapUrl as aw, buildPermissionsPolicy as ax, buildRangeHeader as ay, buildReferrerPolicy as az, type CacheControlOptions as b, searchHeaders as b0, searchStatusCodes as b1, splitSitemap as b2, statusCodeToText as b3, typeNumberToLabel as b4, validateDomain as b5, validateHeaderName as b6, validateHeaderValue as b7, validateManifest as b8, validateRobotsTxt as b9, validateSitemap as ba, type CacheControlResult as c, type ClientHintDef as d, type ClientHintValueType as e, type ClientHintsBuildResult as f, type ClientHintsParseResult as g, type ContentDispositionBuildOptions as h, type ContentDispositionBuildResult as i, type ContentDispositionParseResult as j, type ContentRangeResult as k, type ContentTypeRiskResult as l, type ContentTypeSniffRisk as m, network as n, type CookieAttributes as o, type CookieCheckResult as p, type DnsRecord as q, type DnsRecordType as r, type DnsResponse as s, type EmailHeaderField as t, type HarEntry as u, type HarParseResult as v, type HarSummary as w, type HeaderCategory as x, type HttpHeader as y, type Ipv6ParseResult as z };
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
|
|
22
22
|
* - vary-header-builder: buildVaryHeader, parseVaryHeader
|
|
23
23
|
* - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
|
|
24
|
+
* - x-content-type-options-builder: buildXContentTypeOptionsHeader, parseXContentTypeOptionsHeader, assessContentTypeRisk
|
|
24
25
|
*/
|
|
25
26
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
26
27
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -702,6 +703,46 @@ declare function buildContentDisposition(options?: ContentDispositionBuildOption
|
|
|
702
703
|
declare function parseContentDisposition(header: string): ContentDispositionParseResult | {
|
|
703
704
|
error: string;
|
|
704
705
|
};
|
|
706
|
+
declare const X_CONTENT_TYPE_OPTIONS_HEADER = "X-Content-Type-Options: nosniff";
|
|
707
|
+
interface XContentTypeOptionsHeader {
|
|
708
|
+
header: string;
|
|
709
|
+
value: 'nosniff';
|
|
710
|
+
explanation: string;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Build the X-Content-Type-Options header. There is only one valid value,
|
|
714
|
+
* so this simply returns the fixed header plus a plain-English explanation
|
|
715
|
+
* of the MIME-sniffing attack it prevents.
|
|
716
|
+
*/
|
|
717
|
+
declare function buildXContentTypeOptionsHeader(): XContentTypeOptionsHeader;
|
|
718
|
+
interface XContentTypeOptionsParseResult {
|
|
719
|
+
raw: string;
|
|
720
|
+
valid: boolean;
|
|
721
|
+
message: string;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Validate a pasted X-Content-Type-Options header value. The header only
|
|
725
|
+
* has one correct value ("nosniff"); anything else is either a typo or a
|
|
726
|
+
* no-op the browser ignores.
|
|
727
|
+
*/
|
|
728
|
+
declare function parseXContentTypeOptionsHeader(rawHeader: string): XContentTypeOptionsParseResult | {
|
|
729
|
+
error: string;
|
|
730
|
+
};
|
|
731
|
+
type ContentTypeSniffRisk = 'high' | 'medium' | 'low';
|
|
732
|
+
interface ContentTypeRiskResult {
|
|
733
|
+
contentType: string;
|
|
734
|
+
risk: ContentTypeSniffRisk;
|
|
735
|
+
reason: string;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Assess how risky it is to serve a given Content-Type without the
|
|
739
|
+
* X-Content-Type-Options: nosniff header, based on well-known MIME-sniffing
|
|
740
|
+
* attack surfaces. This is a heuristic classification, not a security scan
|
|
741
|
+
* of an actual response.
|
|
742
|
+
*/
|
|
743
|
+
declare function assessContentTypeRisk(contentType: string): ContentTypeRiskResult | {
|
|
744
|
+
error: string;
|
|
745
|
+
};
|
|
705
746
|
|
|
706
747
|
type network_AuthResultEntry = AuthResultEntry;
|
|
707
748
|
type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
|
|
@@ -717,6 +758,8 @@ type network_ContentDispositionBuildOptions = ContentDispositionBuildOptions;
|
|
|
717
758
|
type network_ContentDispositionBuildResult = ContentDispositionBuildResult;
|
|
718
759
|
type network_ContentDispositionParseResult = ContentDispositionParseResult;
|
|
719
760
|
type network_ContentRangeResult = ContentRangeResult;
|
|
761
|
+
type network_ContentTypeRiskResult = ContentTypeRiskResult;
|
|
762
|
+
type network_ContentTypeSniffRisk = ContentTypeSniffRisk;
|
|
720
763
|
type network_CookieAttributes = CookieAttributes;
|
|
721
764
|
type network_CookieCheckResult = CookieCheckResult;
|
|
722
765
|
declare const network_DNS_RECORD_TYPES: typeof DNS_RECORD_TYPES;
|
|
@@ -775,7 +818,11 @@ type network_UaDeviceType = UaDeviceType;
|
|
|
775
818
|
type network_UserAgentInfo = UserAgentInfo;
|
|
776
819
|
type network_VaryHeaderEntry = VaryHeaderEntry;
|
|
777
820
|
type network_VaryHeaderResult = VaryHeaderResult;
|
|
821
|
+
type network_XContentTypeOptionsHeader = XContentTypeOptionsHeader;
|
|
822
|
+
type network_XContentTypeOptionsParseResult = XContentTypeOptionsParseResult;
|
|
823
|
+
declare const network_X_CONTENT_TYPE_OPTIONS_HEADER: typeof X_CONTENT_TYPE_OPTIONS_HEADER;
|
|
778
824
|
declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
|
|
825
|
+
declare const network_assessContentTypeRisk: typeof assessContentTypeRisk;
|
|
779
826
|
declare const network_buildCacheControl: typeof buildCacheControl;
|
|
780
827
|
declare const network_buildClientHints: typeof buildClientHints;
|
|
781
828
|
declare const network_buildContentDisposition: typeof buildContentDisposition;
|
|
@@ -787,6 +834,7 @@ declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
|
|
|
787
834
|
declare const network_buildRangeHeader: typeof buildRangeHeader;
|
|
788
835
|
declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
|
|
789
836
|
declare const network_buildVaryHeader: typeof buildVaryHeader;
|
|
837
|
+
declare const network_buildXContentTypeOptionsHeader: typeof buildXContentTypeOptionsHeader;
|
|
790
838
|
declare const network_checkSetCookieHeader: typeof checkSetCookieHeader;
|
|
791
839
|
declare const network_countryCodeToFlag: typeof countryCodeToFlag;
|
|
792
840
|
declare const network_formatCoordinates: typeof formatCoordinates;
|
|
@@ -812,6 +860,7 @@ declare const network_parseIpv6Address: typeof parseIpv6Address;
|
|
|
812
860
|
declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
|
|
813
861
|
declare const network_parseUserAgent: typeof parseUserAgent;
|
|
814
862
|
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
863
|
+
declare const network_parseXContentTypeOptionsHeader: typeof parseXContentTypeOptionsHeader;
|
|
815
864
|
declare const network_searchHeaders: typeof searchHeaders;
|
|
816
865
|
declare const network_searchStatusCodes: typeof searchStatusCodes;
|
|
817
866
|
declare const network_splitSitemap: typeof splitSitemap;
|
|
@@ -824,7 +873,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
824
873
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
825
874
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
826
875
|
declare namespace network {
|
|
827
|
-
export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
876
|
+
export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
828
877
|
}
|
|
829
878
|
|
|
830
|
-
export { type
|
|
879
|
+
export { type ReceivedHop as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type LinkHeaderEntry as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type LinkHeaderEntryInput as J, type LinkHeaderResult as K, LINK_REL_VALUES as L, type LinkRel as M, type ManifestIconInfo as N, type ManifestIssue as O, type ManifestValidationResult as P, PERMISSIONS_POLICY_FEATURES as Q, type ParsedClientHint as R, type ParsedDnsResult as S, type ParsedGeoResult as T, type PermissionsPolicyDirective as U, type PermissionsPolicyFeatureInput as V, type PermissionsPolicyResult as W, REFERRER_POLICY_VALUES as X, type RangeEntry as Y, type RangeEntryInput as Z, type RangeHeaderResult as _, type CacheControlDirective as a, parseXContentTypeOptionsHeader as a$, type ReferrerPolicyEntry as a0, type ReferrerPolicyResult as a1, type ReferrerPolicyValue as a2, type RobotsGroup as a3, type RobotsIssue as a4, type RobotsRule as a5, type RobotsValidationResult as a6, STATUS_CODES as a7, type SameSiteValue as a8, type SitemapIndexEntry as a9, buildVaryHeader as aA, buildXContentTypeOptionsHeader as aB, checkSetCookieHeader as aC, countryCodeToFlag as aD, formatCoordinates as aE, formatTtl as aF, getByCategory as aG, getHeader as aH, getHeadersByCategory as aI, getStatusByCategory as aJ, getStatusCode as aK, isClientError as aL, isServerError as aM, isSuccess as aN, isValidIp as aO, isValidIpv4 as aP, isValidIpv6 as aQ, parseClientHintHeaders as aR, parseContentDisposition as aS, parseContentRangeHeader as aT, parseDnsResponse as aU, parseGeoResponse as aV, parseHar as aW, parseIpv6Address as aX, parsePermissionsPolicy as aY, parseUserAgent as aZ, parseVaryHeader as a_, type SitemapIssue as aa, type SitemapSplitFile as ab, type SitemapUrlEntry as ac, type SitemapValidationResult as ad, type SplitSitemapOptions as ae, type SplitSitemapResult as af, type StatusCode as ag, type UaDeviceType as ah, type UserAgentInfo as ai, type VaryHeaderEntry as aj, type VaryHeaderResult as ak, type XContentTypeOptionsHeader as al, type XContentTypeOptionsParseResult as am, X_CONTENT_TYPE_OPTIONS_HEADER as an, analyzeEmailHeaders as ao, assessContentTypeRisk as ap, buildCacheControl as aq, buildClientHints as ar, buildContentDisposition as as, buildDnsQueryUrl as at, buildGeoUrl as au, buildLinkHeader as av, buildMapUrl as aw, buildPermissionsPolicy as ax, buildRangeHeader as ay, buildReferrerPolicy as az, type CacheControlOptions as b, searchHeaders as b0, searchStatusCodes as b1, splitSitemap as b2, statusCodeToText as b3, typeNumberToLabel as b4, validateDomain as b5, validateHeaderName as b6, validateHeaderValue as b7, validateManifest as b8, validateRobotsTxt as b9, validateSitemap as ba, type CacheControlResult as c, type ClientHintDef as d, type ClientHintValueType as e, type ClientHintsBuildResult as f, type ClientHintsParseResult as g, type ContentDispositionBuildOptions as h, type ContentDispositionBuildResult as i, type ContentDispositionParseResult as j, type ContentRangeResult as k, type ContentTypeRiskResult as l, type ContentTypeSniffRisk as m, network as n, type CookieAttributes as o, type CookieCheckResult as p, type DnsRecord as q, type DnsRecordType as r, type DnsResponse as s, type EmailHeaderField as t, type HarEntry as u, type HarParseResult as v, type HarSummary as w, type HeaderCategory as x, type HttpHeader as y, type Ipv6ParseResult as z };
|