better-hosts 0.1.16 → 0.1.17
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/cli.cjs +17 -18
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -3354,29 +3354,27 @@ function startServer({ logger, timeout, port, hosts, fallbackServer }) {
|
|
|
3354
3354
|
ttl: 0,
|
|
3355
3355
|
address: result.address
|
|
3356
3356
|
});
|
|
3357
|
-
return sendResponse();
|
|
3358
3357
|
}
|
|
3359
3358
|
else {
|
|
3360
3359
|
logger.info(`${formatHostname(question.name)} No records for ${record_types_1.RecordType[question.type]}`);
|
|
3361
3360
|
res.header.rcode = dns.consts.NAME_TO_RCODE.NOERROR;
|
|
3362
|
-
return sendResponse();
|
|
3363
3361
|
}
|
|
3364
3362
|
}
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
logger.trace(`response: ${JSON.stringify(res)}`);
|
|
3378
|
-
res.send();
|
|
3363
|
+
else {
|
|
3364
|
+
const startTime = Date.now();
|
|
3365
|
+
const [err, response] = await (0, return_style_1.getErrorResultAsync)(() => resolve(fallbackServer, question, timeout));
|
|
3366
|
+
if (err) {
|
|
3367
|
+
logger.error(`${formatHostname(question.name)} ${err}`, getElapsed(startTime));
|
|
3368
|
+
}
|
|
3369
|
+
else {
|
|
3370
|
+
logger.info(`${formatHostname(question.name)} ${record_types_1.RecordType[question.type]}`, getElapsed(startTime));
|
|
3371
|
+
res.header.rcode = response.header.rcode;
|
|
3372
|
+
res.answer = response.answer;
|
|
3373
|
+
res.authority = response.authority;
|
|
3374
|
+
}
|
|
3379
3375
|
}
|
|
3376
|
+
logger.trace(`response: ${JSON.stringify(res)}`);
|
|
3377
|
+
res.send();
|
|
3380
3378
|
});
|
|
3381
3379
|
return server.serve(port);
|
|
3382
3380
|
}
|
|
@@ -4634,7 +4632,8 @@ function writeSoa(buff, val, label_index) {
|
|
|
4634
4632
|
assertUndefined(val.minimum, 'SOA record requires "minimum"');
|
|
4635
4633
|
namePack(val.primary, buff, label_index);
|
|
4636
4634
|
namePack(val.admin, buff, label_index);
|
|
4637
|
-
|
|
4635
|
+
const serial = val.serial & 0xFFFFFFFF
|
|
4636
|
+
buff.writeUInt32BE(serial < 0 || serial > 4294967295 ? 0 : serial);
|
|
4638
4637
|
buff.writeInt32BE(val.refresh & 0xFFFFFFFF);
|
|
4639
4638
|
buff.writeInt32BE(val.retry & 0xFFFFFFFF);
|
|
4640
4639
|
buff.writeInt32BE(val.expiration & 0xFFFFFFFF);
|
|
@@ -49144,7 +49143,7 @@ exports.waitForAllMacrotasksProcessed = waitForAllMacrotasksProcessed;
|
|
|
49144
49143
|
/***/ ((module) => {
|
|
49145
49144
|
|
|
49146
49145
|
"use strict";
|
|
49147
|
-
module.exports = JSON.parse('{"name":"better-hosts","version":"0.1.
|
|
49146
|
+
module.exports = JSON.parse('{"name":"better-hosts","version":"0.1.17","description":"","keywords":["dns"],"bin":"dist/cli.cjs","files":["dist"],"repository":"git@github.com:BlackGlory/better-hosts.git","author":"BlackGlory <woshenmedoubuzhidao@blackglory.me>","license":"MIT","scripts":{"deduplicate":"yarn-deduplicate","prepublishOnly":"run-s clean build bundle","postinstall":"patch-package","lint":"eslint --ext .js,.jsx,.ts,.tsx --quiet src","test":"jest --config jest.config.js","test:debug":"node --inspect-brk node_modules/.bin/jest --runInBand","test:coverage":"jest --coverage --config jest.config.js","clean":"rimraf lib dist","build":"run-s build:*","build:compile":"tsc --project tsconfig.build.json","build:patch":"tscpaths --project tsconfig.build.json --src ./src --out ./lib","bundle":"webpack --stats-error-details","smoke":"node dist/cli.cjs --help","release":"standard-version"},"husky":{"hooks":{"pre-commit":"run-s clean lint build test bundle smoke","commit-msg":"commitlint --env HUSKY_GIT_PARAMS"}},"devDependencies":{"@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@types/jest":"^28.1.6","@types/node":"14","@typescript-eslint/eslint-plugin":"^5.32.0","@typescript-eslint/parser":"^5.32.0","eslint":"^8.21.0","husky":"4","jest":"^28.1.3","npm-run-all":"^4.1.5","rimraf":"^3.0.2","standard-version":"^9.5.0","ts-jest":"^28.0.7","tsconfig-paths":"^4.0.0","tscpaths":"^0.0.9","typescript":"^4.7.4","webpack":"^5.74.0","webpack-cli":"^4.10.0","webpack-shebang-plugin":"^1.1.7","yarn-deduplicate":"^5.0.0"},"dependencies":{"@blackglory/errors":"^2.2.2","@blackglory/go":"^1.1.2","@blackglory/prelude":"^0.1.3","@blackglory/types":"^1.2.1","chalk":"^4.1.2","commander":"^9.4.0","extra-filesystem":"^0.4.5","extra-logger":"^0.6.9","extra-promise":"^2.3.0","extra-watcher":"^0.2.0","iterable-operator":"^1.1.0","native-node-dns":"0.7.6","native-node-dns-packet":"0.1.5","patch-package":"^6.4.7","return-style":"^1.0.0"}}');
|
|
49148
49147
|
|
|
49149
49148
|
/***/ })
|
|
49150
49149
|
/******/ ]);
|