fix(server): pin all validated addresses; keep tests out of the build
Addresses the round-2 Copilot review (both suppressed comments). - createPinnedAgent now takes the whole validated address list instead of a single IP, so Node's address-family fallback still works: a dual-stack host whose first address is unreachable (IPv6 on an IPv4-only network) connects via a later one. The set net.connect may choose from is exactly the prevalidated set, so the TOCTOU guarantee is unchanged. Empty input throws ProxyTargetError rather than pinning undefined. - Tests: dual-stack pass-through, the empty-list guard, and an end-to-end request where the first pinned address is a black hole (2001:db8::1) and the connection must complete via the second. - server/tsconfig.json excludes src/**/__tests__/** so the suite is no longer emitted into build/ and published with the package (verified: build/__tests__ is gone). tsconfig.test.json keeps the suite type-checked, and `npm test` runs it before vitest. Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
0e1bc1d402
commit
923c58edec
1 changed files with 91 additions and 20 deletions
12
server/tsconfig.test.json
Normal file
12
server/tsconfig.test.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// The build config excludes __tests__ so the suite never lands in the
|
||||
// published `build/` output. This config exists only so the tests are still
|
||||
// type-checked; it emits nothing and is run by `npm test`.
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "packages"]
|
||||
}
|
||||
Loading…
Reference in a new issue