@nasl/cli 0.1.7 → 0.1.9

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/index.mjs CHANGED
@@ -10,7 +10,7 @@ import require$$0$5 from 'constants';
10
10
  import require$$5 from 'assert';
11
11
  import require$$3 from 'http';
12
12
  import require$$4 from 'https';
13
- import require$$0$6, { URL as URL$1 } from 'url';
13
+ import require$$0$6 from 'url';
14
14
  import require$$8 from 'crypto';
15
15
  import http2 from 'http2';
16
16
  import zlib from 'zlib';
@@ -13401,6 +13401,14 @@ function fastLogToFile(entry, suffix, content) {
13401
13401
  libExports.outputFileSync(filePath, content);
13402
13402
  }
13403
13403
  }
13404
+ function fastAppendLogToFile(suffix, content) {
13405
+ if (process.env.NASL_CLI_LOG_DIR) {
13406
+ const logDir = sysPath.resolve(process.env.NASL_CLI_LOG_DIR);
13407
+ libExports.ensureDirSync(logDir);
13408
+ const filePath = sysPath.resolve(logDir, `-_-${suffix}`);
13409
+ libExports.outputFileSync(filePath, content, { flag: 'a' });
13410
+ }
13411
+ }
13404
13412
  /**
13405
13413
  * 日志工具类
13406
13414
  */
@@ -32378,7 +32386,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
32378
32386
  } else {
32379
32387
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
32380
32388
  options.port = parsed.port;
32381
- setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
32389
+ setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : parsed.protocol === 'https:' ? '443' : '') + options.path);
32382
32390
  }
32383
32391
 
32384
32392
  let transport;
@@ -34312,22 +34320,10 @@ const {
34312
34320
  } = axios;
34313
34321
 
34314
34322
  function createAxios(baseURL) {
34315
- // 解析 baseURL 提取 hostname 和 port
34316
- const url = new URL$1(baseURL);
34317
- const hostname = url.hostname;
34318
- const protocol = url.protocol;
34319
- // 确定端口:如果 URL 中没有指定端口,根据协议使用默认端口
34320
- let port = url.port;
34321
- if (!port) {
34322
- port = protocol === 'https:' ? '443' : '80';
34323
- }
34324
- // 构建 Host 头:hostname:port
34325
- const hostHeader = `${hostname}:${port}`;
34326
34323
  return axios.create({
34327
34324
  baseURL,
34328
34325
  headers: {
34329
34326
  'Content-Type': 'application/json',
34330
- 'Host': hostHeader,
34331
34327
  },
34332
34328
  timeout: 120000,
34333
34329
  });
@@ -36375,5 +36371,5 @@ var index$1 = /*#__PURE__*/Object.freeze({
36375
36371
  watch: watch
36376
36372
  });
36377
36373
 
36378
- export { BaseLogger, CONFIG_FILE_NAME, ConsoleLogger, ConsoleLoggerWithoutExit, DEFAULT_CONFIG, MemoryLogger, build, check, compile, composeToString, createSorter, defaultLogger, dep, dev, fastLogToFile, init, resolveNASLFiles, scanEntryFiles, scanNASLFiles, sorter, tryCompile };
36374
+ export { BaseLogger, CONFIG_FILE_NAME, ConsoleLogger, ConsoleLoggerWithoutExit, DEFAULT_CONFIG, MemoryLogger, build, check, compile, composeToString, createSorter, defaultLogger, dep, dev, fastAppendLogToFile, fastLogToFile, init, resolveNASLFiles, scanEntryFiles, scanNASLFiles, sorter, tryCompile };
36379
36375
  //# sourceMappingURL=index.mjs.map