Skip to content

fix: replace fetch() with SDK HTTP client in checkMalware#544

Merged
John-David Dalton (jdalton) merged 1 commit into
mainfrom
fix/check-malware-improvements
Apr 3, 2026
Merged

fix: replace fetch() with SDK HTTP client in checkMalware#544
John-David Dalton (jdalton) merged 1 commit into
mainfrom
fix/check-malware-improvements

Conversation

@jdalton
Copy link
Copy Markdown
Collaborator

Summary

  • Replace fetch() with createGetRequest/getResponseJson from the SDK HTTP client in checkMalware — enables nock interception, retries, timeouts, hooks, and agent config
  • Route by component count instead of token type: ≤ MAX_FIREWALL_COMPONENTS (8) uses parallel firewall API, > 8 uses batch PURL API
  • Both paths now normalize alerts through publicPolicy (batch path was previously using server-assigned action field)
  • Remove all c8 ignore blocks from checkMalware methods
  • Add MAX_FIREWALL_COMPONENTS constant
  • Add CLAUDE.md rule: never use fetch() in SDK code

Test plan

  • pnpm run fix --all passes
  • pnpm check --all passes
  • pnpm test passes (592 tests)

@jdalton John-David Dalton (jdalton) merged commit 305cc3b into main Apr 3, 2026
10 checks passed
@jdalton John-David Dalton (jdalton) deleted the fix/check-malware-improvements branch April 3, 2026 16:06
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.

2 participants