badmfck-api-server 4.1.8 → 4.1.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.
@@ -98,7 +98,7 @@ async function Initializer(services) {
98
98
  }
99
99
  exports.Initializer = Initializer;
100
100
  class APIService extends BaseService_1.BaseService {
101
- version = "4.1.07";
101
+ version = "4.1.09";
102
102
  options;
103
103
  monitor = null;
104
104
  started = new Date();
@@ -481,7 +481,8 @@ class APIService extends BaseService_1.BaseService {
481
481
  if (this.options.appVersion)
482
482
  data.version = this.options.appVersion;
483
483
  if (res.socket?.destroyed || res.writableEnded || res.headersSent || (res.destroyed !== undefined && res.destroyed)) {
484
- (0, LogService_1.logAPI)("Connection already closed, can't send response for: " + data.endpoint);
484
+ if (!data.ignoreHttpLogging)
485
+ (0, LogService_1.logAPI)("Connection already closed, can't send response for: " + data.endpoint);
485
486
  }
486
487
  else {
487
488
  try {
@@ -489,7 +490,8 @@ class APIService extends BaseService_1.BaseService {
489
490
  const normalizedFile = process.platform === "win32" ? data.file : data.file.replaceAll("\\", "/");
490
491
  const filePath = path_1.default.isAbsolute(normalizedFile) ? normalizedFile : path_1.default.resolve(normalizedFile);
491
492
  const onSendFileError = (err) => {
492
- (0, LogService_1.logError)("Can't send file: " + filePath);
493
+ if (!data.ignoreHttpLogging)
494
+ (0, LogService_1.logError)("Can't send file: " + filePath);
493
495
  if (!res.headersSent && !res.writableEnded) {
494
496
  res.status(500).send({ error: DefaultErrors_1.default.CANT_SEND_FILE, data: null });
495
497
  return;
@@ -520,7 +522,8 @@ class APIService extends BaseService_1.BaseService {
520
522
  }
521
523
  if (data.redirect) {
522
524
  res.redirect(data.redirect);
523
- (0, LogService_1.logAPI)("redirect: " + data.redirect);
525
+ if (!data.ignoreHttpLogging)
526
+ (0, LogService_1.logAPI)("redirect: " + data.redirect);
524
527
  }
525
528
  else {
526
529
  if (data.headers) {
@@ -533,11 +536,13 @@ class APIService extends BaseService_1.BaseService {
533
536
  res.statusCode = data.httpStatus ?? 200;
534
537
  if (data.rawResponse) {
535
538
  res.send(data.data);
536
- (0, LogService_1.logAPI)(this.checkDataLength(data));
539
+ if (!data.ignoreHttpLogging)
540
+ (0, LogService_1.logAPI)(this.checkDataLength(data));
537
541
  }
538
542
  else {
539
543
  res.send(data);
540
- (0, LogService_1.logAPI)(this.checkDataLength(data));
544
+ if (!data.ignoreHttpLogging)
545
+ (0, LogService_1.logAPI)(this.checkDataLength(data));
541
546
  }
542
547
  }
543
548
  }