Skip to content

test: fix SSRF expansion mock injection and error assertions#500

Merged
jithinraj merged 1 commit intomainfrom
fix/ssrf-error-preservation
Mar 9, 2026
Merged

test: fix SSRF expansion mock injection and error assertions#500
jithinraj merged 1 commit intomainfrom
fix/ssrf-error-preservation

Conversation

@jithinraj
Copy link
Member

Summary

Corrects SSRF expansion test wiring and assertions in @peac/net-node.

This PR:

  • fixes mock dependency injection in SSRF expansion tests so mocked DNS/HTTP paths are actually used
  • updates the IPv6 private-range assertion to verify the specific SSRF error code preserved by the call chain
  • corrects the empty-hostname test case so it uses a truly invalid URL

No runtime behavior, protocol surface, or public API contract is changed by this PR.

Changes

  • replace dnsResolver / httpClient test options with the correct internal injection fields:
    • _dnsResolver
    • _httpClient
  • update the IPv6 private-range assertion to expect E_SSRF_DNS_RESOLVED_PRIVATE
  • replace https:///path with https:// in the empty-hostname test

Validation

  • vitest run packages/net/node/tests/ssrf-expansion.test.ts passes
  • pnpm --filter @peac/net-node exec vitest run passes
  • full repo checks pass:
    • lint
    • build
    • test
    • guard

Closes #483

@jithinraj jithinraj merged commit 146de41 into main Mar 9, 2026
10 checks passed
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.

test: fix SSRF expansion mock injection and error assertions

1 participant