@sdxc/outbound 2026.10.6 → 2026.10.10
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.
- package/dist/resolve.js +11 -1
- package/package.json +3 -3
package/dist/resolve.js
CHANGED
|
@@ -26,7 +26,7 @@ export async function resolveHost(url, options = {}) {
|
|
|
26
26
|
let literal = IP.parse(url.hostname);
|
|
27
27
|
if (isSuccess(literal))
|
|
28
28
|
return success([literal.data.toString()]);
|
|
29
|
-
let host = url.hostname
|
|
29
|
+
let host = withoutTrailingDots(url.hostname);
|
|
30
30
|
let lookup = options.signal ? { signal: options.signal } : {};
|
|
31
31
|
let [a, aaaa] = await Promise.all([resolve(host, "A", lookup), resolve(host, "AAAA", lookup)]);
|
|
32
32
|
if (isFailure(a))
|
|
@@ -60,3 +60,13 @@ function lookupFailed(url, host, error) {
|
|
|
60
60
|
cause: error,
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* The host name without the root-zone dots that end a fully qualified name, scanned from
|
|
65
|
+
* the end so a name holding thousands of dots still costs linear time.
|
|
66
|
+
*/
|
|
67
|
+
function withoutTrailingDots(hostname) {
|
|
68
|
+
let end = hostname.length;
|
|
69
|
+
while (end > 0 && hostname[end - 1] === ".")
|
|
70
|
+
end--;
|
|
71
|
+
return hostname.slice(0, end);
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdxc/outbound",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.10",
|
|
4
4
|
"description": "Check, follow and read URLs a stranger chose: public hosts on every redirect, one deadline, bounded bodies",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
".": "./dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@sdxc/doh": "2026.10.
|
|
11
|
+
"@sdxc/doh": "2026.10.10",
|
|
12
12
|
"@sdxc/duration": "2026.10.6",
|
|
13
13
|
"@sdxc/ip": "2026.10.6",
|
|
14
14
|
"@sdxc/result": "2026.10.6"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "b61f19c59866708a2d89a5a8f4655ebbc16941b0",
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|