@caido-utils/backend 0.5.3 → 0.5.5
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/dist/requests/query.d.ts
CHANGED
package/dist/requests/query.js
CHANGED
|
@@ -61,7 +61,7 @@ const STATIC_CONTENT_TYPES = [
|
|
|
61
61
|
];
|
|
62
62
|
const STATIC_ASSET_FILTER = [
|
|
63
63
|
...STATIC_EXTENSIONS.map((ext) => `req.ext.nlike:"%.${ext}"`),
|
|
64
|
-
...STATIC_CONTENT_TYPES.map((ct) => `resp.raw.
|
|
64
|
+
...STATIC_CONTENT_TYPES.map((ct) => `resp.raw.ncont:"${ct}"`)
|
|
65
65
|
].join(" AND ");
|
|
66
66
|
export async function queryRequests(sdk, options) {
|
|
67
67
|
const pageSize = options?.pageSize ?? 1e3;
|
|
@@ -94,5 +94,13 @@ export async function queryRequests(sdk, options) {
|
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
if (options?.deduplicate) {
|
|
98
|
+
const seen = /* @__PURE__ */ new Map();
|
|
99
|
+
for (const item of results) {
|
|
100
|
+
const key = `${item.request.getMethod()}|${item.request.getHost()}|${item.request.getPath()}`;
|
|
101
|
+
seen.set(key, item);
|
|
102
|
+
}
|
|
103
|
+
return Array.from(seen.values());
|
|
104
|
+
}
|
|
97
105
|
return results;
|
|
98
106
|
}
|