fix(javascript): keep keyed-collection reads out of endpoints
Static endpoint extraction read the first literal argument of any call
named get, post, put, patch, delete, or request as an HTTP request URL.
Reads of a provable keyed collection also became network endpoints in
application and web bundle analysis: `new URLSearchParams(...).get("q")`,
`response.headers.get("content-type")`, `new Map().get("key")`, and
`url.searchParams.get("page")`.
Skip these calls only when the receiver is a constructed Map, WeakMap,
Set, WeakSet, Headers, FormData, or URLSearchParams, or a platform
`headers`/`searchParams` property. Any other receiver may still be an
HTTP client with a base URL, so `api.get("users")` keeps its endpoint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8e8921d40c
commit
eb68761eb0
@@ -147,7 +147,7 @@ const inspectCall = (
|
||||
accumulator,
|
||||
});
|
||||
}
|
||||
const endpoint = endpointArgument(name, node.arguments);
|
||||
const endpoint = endpointArgument(name, node.arguments, node.callee);
|
||||
if (endpoint !== undefined)
|
||||
addFinding({
|
||||
collection: accumulator.endpoints,
|
||||
|
||||
Reference in New Issue
Block a user