Skip to content

fix(trace): exclude non-HTTP URL schemes like data: URLs from HTTP accesses - #80

Open
Cid-oe wants to merge 1 commit into
aoto-tech:mainfrom
Cid-oe:fix/issue-74-trace-fetch-data-urls
Open

fix(trace): exclude non-HTTP URL schemes like data: URLs from HTTP accesses#80
Cid-oe wants to merge 1 commit into
aoto-tech:mainfrom
Cid-oe:fix/issue-74-trace-fetch-data-urls

Conversation

@Cid-oe

@Cid-oe Cid-oe commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Resolves #74

Summary

When globalThis.fetch is invoked with non-HTTP(S) schemes such as data: URLs (e.g., fetch("data:text/plain,hello")), the response body is resolved locally without performing an HTTP network request. Previously, fetchSelector treated any valid string/URL as an HTTP target, causing local data processing to be recorded as an HTTP resource access (kind: "http", access: "call").

Changes

  • Updated fetchSelector in packages/trace/src/index.ts to validate that the URL protocol is http: or https:.
  • Added unit tests in tests/trace.test.mjs verifying that fetch calls with non-HTTP schemes (such as data:text/plain and data:application/json) are excluded from HTTP evidence while valid HTTP/HTTPS requests continue to be captured.
  • Verified that the full test suite passes (1,196 passing tests).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: [P2] trace records fetch calls to data: URLs as HTTP accesses

1 participant