@cosmicdrift/kumiko-http 0.288.0 → 0.289.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/policy.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-http",
3
- "version": "0.288.0",
3
+ "version": "0.289.0",
4
4
  "description": "SSRF-safe egress fetch for Kumiko: a single egress(policy) entry point that enforces external/internal/tenant-supplied host policy, DNS-rebinding-safe resolve-then-pin, and no external runtime dependencies.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
package/src/policy.ts CHANGED
@@ -171,7 +171,7 @@ export async function resolvePublicHost(
171
171
  if (blocked) {
172
172
  throw new Error(`egress: host resolves to a non-public address: ${host} -> ${blocked.address}`);
173
173
  }
174
- const [chosen] = addresses;
174
+ const chosen = addresses.find((address) => address.family === 4) ?? addresses[0];
175
175
  if (!chosen) {
176
176
  throw new Error(`egress: DNS resolution returned no records for host: ${host}`);
177
177
  }