fix(javascript): keep computed-method XHR request URLs
A computed XHR method, as in `xhr.open(method, "/api")`, no longer discarded an endpoint that main reports. Keep the URL when it is an HTTP(S)/WebSocket URL or a path; fs flags and window targets such as `r` and `_blank` still produce no 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
602d0021d4
@@ -183,11 +183,18 @@ describe("web bundle static-analysis parity", () => {
|
||||
fs.open("/tmp/data.txt", "r", done);
|
||||
window.open("https://help.example.test/", "_blank");
|
||||
xhr.open(method, "/dynamic-method");
|
||||
fs.open(path, "r", done);
|
||||
window.open(url, "_blank");
|
||||
`),
|
||||
);
|
||||
expect(
|
||||
result.observations.endpoints.map(({ value }) => value).sort(),
|
||||
).toEqual(["/dav/", "/xhr-get", "https://xhr.example.test/submit"]);
|
||||
).toEqual([
|
||||
"/dav/",
|
||||
"/dynamic-method",
|
||||
"/xhr-get",
|
||||
"https://xhr.example.test/submit",
|
||||
]);
|
||||
});
|
||||
|
||||
it("recognizes loadURL endpoints like static analysis", () => {
|
||||
|
||||
Reference in New Issue
Block a user