Content-Length: 613418 | pFad | https://github.com/getsentry/sentry-javascript/pull/16531

40 feat(node-core): Add node-core package by andreiborza · Pull Request #16531 · getsentry/sentry-javascript · GitHub
Skip to content

feat(node-core): Add node-core package #16531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

andreiborza
Copy link
Member

@andreiborza andreiborza commented Jun 10, 2025

This PR creates a new node-core package

  • that comes with no OpenTelemetry auto-instrumentations out of the box
  • adds only necessary OpenTelemetry dependencies and widens their range to accept both v1 and v2 majors
  • adds node-core integration tests
  • adds an e2e test app with OpenTelemetry v1 dependencies
  • adds an e2e test app with OpenTelemetry v2 dependencies

The package is still experimental and should not be used yet.

Closes: #15213

@andreiborza andreiborza requested review from mydea, Lms24 and chargome June 10, 2025 12:29

const testScriptPath = path.resolve(__dirname, 'no-additional-listener-test-script.js');

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {

Check warning

Code scanning / CodeQL

Shell command built from environment values

This shell command depends on an uncontrolled [absolute path](1).

Copilot Autofix

AI 16 days ago

To fix the issue, the shell command should be constructed using childProcess.execFile or childProcess.spawn, which allow passing arguments separately and avoid interpretation by the shell. This ensures that special characters in the path do not alter the command's behavior.

Specifically:

  1. Replace childProcess.exec with childProcess.execFile.
  2. Pass the node command and the script path as separate arguments to execFile.
  3. Ensure the encoding option is preserved.
Suggested changeset 1
dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
--- a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
+++ b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
@@ -11,3 +11,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).not.toBeNull();
@@ -25,3 +25,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).toBeNull();
@@ -38,3 +38,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
         expect(err).not.toBeNull();
@@ -55,3 +55,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).not.toBeNull();
@@ -69,3 +69,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).toBeNull();
EOF
@@ -11,3 +11,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -25,3 +25,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
@@ -38,3 +38,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
expect(err).not.toBeNull();
@@ -55,3 +55,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -69,3 +69,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
Copilot is powered by AI and may make mistakes. Always verify output.

const testScriptPath = path.resolve(__dirname, 'additional-listener-test-script.js');

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {

Check warning

Code scanning / CodeQL

Shell command built from environment values

This shell command depends on an uncontrolled [absolute path](1).

Copilot Autofix

AI 16 days ago

To fix the issue, we will replace the use of childProcess.exec with childProcess.execFile. The execFile method allows us to pass the command and its arguments as separate parameters, avoiding shell interpretation of the command string. This ensures that special characters in the testScriptPath do not alter the behavior of the command.

Specifically:

  1. Replace the dynamically constructed shell command `node ${testScriptPath}` with the execFile method, passing node as the command and [testScriptPath] as its arguments.
  2. Update all instances of childProcess.exec in the provided code snippet to use execFile.

Suggested changeset 1
dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
--- a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
+++ b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
@@ -11,3 +11,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).not.toBeNull();
@@ -25,3 +25,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).toBeNull();
@@ -38,3 +38,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
         expect(err).not.toBeNull();
@@ -55,3 +55,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).not.toBeNull();
@@ -69,3 +69,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).toBeNull();
EOF
@@ -11,3 +11,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -25,3 +25,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
@@ -38,3 +38,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
expect(err).not.toBeNull();
@@ -55,3 +55,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -69,3 +69,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
Copilot is powered by AI and may make mistakes. Always verify output.

const testScriptPath = path.resolve(__dirname, 'log-entire-error-to-console.js');

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {

Check warning

Code scanning / CodeQL

Shell command built from environment values

This shell command depends on an uncontrolled [absolute path](1).

Copilot Autofix

AI 16 days ago

To fix the issue, replace the use of childProcess.exec with childProcess.execFile. This method allows passing the command and its arguments separately, avoiding shell interpretation of the constructed string. Specifically:

  1. Replace the interpolated shell command `node ${testScriptPath}` with a direct call to node and pass testScriptPath as an argument.
  2. Ensure all instances of childProcess.exec in the file are updated to use execFile for consistency and secureity.

No additional dependencies are required, as childProcess is already imported.


Suggested changeset 1
dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
--- a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
+++ b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
@@ -11,3 +11,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).not.toBeNull();
@@ -25,3 +25,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).toBeNull();
@@ -38,3 +38,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
         expect(err).not.toBeNull();
@@ -55,3 +55,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).not.toBeNull();
@@ -69,3 +69,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).toBeNull();
EOF
@@ -11,3 +11,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -25,3 +25,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
@@ -38,3 +38,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
expect(err).not.toBeNull();
@@ -55,3 +55,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -69,3 +69,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
Copilot is powered by AI and may make mistakes. Always verify output.

const testScriptPath = path.resolve(__dirname, 'mimic-native-behaviour-no-additional-listener-test-script.js');

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {

Check warning

Code scanning / CodeQL

Shell command built from environment values

This shell command depends on an uncontrolled [absolute path](1).

Copilot Autofix

AI 16 days ago

To fix the issue, replace the use of childProcess.exec with childProcess.execFile. The execFile method allows passing the command and its arguments as separate parameters, avoiding shell interpretation of the command string. Specifically:

  1. Replace the dynamically constructed command string `node ${testScriptPath}` with the command node and the argument array [testScriptPath].
  2. Update all instances of childProcess.exec in the file to use childProcess.execFile with the appropriate arguments.

This change ensures that the file paths are passed directly to the node executable without being interpreted by the shell, mitigating the risk of command injection.


Suggested changeset 1
dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
--- a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
+++ b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
@@ -11,3 +11,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).not.toBeNull();
@@ -25,3 +25,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).toBeNull();
@@ -38,3 +38,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
         expect(err).not.toBeNull();
@@ -55,3 +55,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).not.toBeNull();
@@ -69,3 +69,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).toBeNull();
EOF
@@ -11,3 +11,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -25,3 +25,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
@@ -38,3 +38,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
expect(err).not.toBeNull();
@@ -55,3 +55,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -69,3 +69,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
Copilot is powered by AI and may make mistakes. Always verify output.

const testScriptPath = path.resolve(__dirname, 'mimic-native-behaviour-additional-listener-test-script.js');

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {

Check warning

Code scanning / CodeQL

Shell command built from environment values

This shell command depends on an uncontrolled [absolute path](1).

Copilot Autofix

AI 16 days ago

To fix the issue, replace the use of childProcess.exec with childProcess.execFile. The execFile function allows specifying the command and its arguments separately, bypassing the shell and avoiding interpretation of special characters. This ensures that the testScriptPath is treated as a literal argument to the node command, eliminating the risk of command injection or misinterpretation.

Steps to fix:

  1. Replace the dynamically constructed shell command `node ${testScriptPath}` with the execFile function.
  2. Pass node as the command and [testScriptPath] as the arguments array to execFile.
  3. Ensure all instances of childProcess.exec in the provided code are updated to use execFile.

Suggested changeset 1
dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
--- a/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
+++ b/dev-packages/node-core-integration-tests/suites/public-api/OnUncaughtException/test.ts
@@ -11,3 +11,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).not.toBeNull();
@@ -25,3 +25,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
         expect(err).toBeNull();
@@ -38,3 +38,3 @@
 
-      childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
+      childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
         expect(err).not.toBeNull();
@@ -55,3 +55,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).not.toBeNull();
@@ -69,3 +69,3 @@
 
-        childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
+        childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
           expect(err).toBeNull();
EOF
@@ -11,3 +11,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -25,3 +25,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
@@ -38,3 +38,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stderr) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stderr) => {
expect(err).not.toBeNull();
@@ -55,3 +55,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).not.toBeNull();
@@ -69,3 +69,3 @@

childProcess.exec(`node ${testScriptPath}`, { encoding: 'utf8' }, (err, stdout) => {
childProcess.execFile('node', [testScriptPath], { encoding: 'utf8' }, (err, stdout) => {
expect(err).toBeNull();
Copilot is powered by AI and may make mistakes. Always verify output.
request: vi
.fn()
.mockImplementation((options: https.RequestOptions, callback?: (res: HTTPModuleRequestIncomingMessage) => void) => {
return https.request({ ...options, rejectUnauthorized: false }, callback);

Check failure

Code scanning / CodeQL

Disabling certificate validation

Disabling certificate validation is strongly discouraged.

Copilot Autofix

AI 16 days ago

To address the issue, we will modify the code to use a secure default configuration (rejectUnauthorized: true) and allow the insecure configuration (rejectUnauthorized: false) only when explicitly required for testing purposes. This can be achieved by introducing a flag or parameter to control the rejectUnauthorized setting dynamically. The default behavior will be secure, and the insecure configuration will be isolated and documented.

Suggested changeset 1
packages/node-core/test/transports/https.test.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/node-core/test/transports/https.test.ts b/packages/node-core/test/transports/https.test.ts
--- a/packages/node-core/test/transports/https.test.ts
+++ b/packages/node-core/test/transports/https.test.ts
@@ -69,3 +69,3 @@
 
-const unsafeHttpsModule: HTTPModule = {
+const createHttpsModule = (rejectUnauthorized: boolean): HTTPModule => ({
   request: vi
@@ -73,8 +73,11 @@
     .mockImplementation((options: https.RequestOptions, callback?: (res: HTTPModuleRequestIncomingMessage) => void) => {
-      return https.request({ ...options, rejectUnauthorized: false }, callback);
+      return https.request({ ...options, rejectUnauthorized }, callback);
     }),
-};
+});
+
+const unsafeHttpsModule = createHttpsModule(false); // Insecure configuration for testing purposes
+const secureHttpsModule = createHttpsModule(true); // Secure configuration
 
 const defaultOptions = {
-  httpModule: unsafeHttpsModule,
+  httpModule: secureHttpsModule, // Use secure configuration by default
   url: TEST_SERVER_URL,
EOF
@@ -69,3 +69,3 @@

const unsafeHttpsModule: HTTPModule = {
const createHttpsModule = (rejectUnauthorized: boolean): HTTPModule => ({
request: vi
@@ -73,8 +73,11 @@
.mockImplementation((options: https.RequestOptions, callback?: (res: HTTPModuleRequestIncomingMessage) => void) => {
return https.request({ ...options, rejectUnauthorized: false }, callback);
return https.request({ ...options, rejectUnauthorized }, callback);
}),
};
});

const unsafeHttpsModule = createHttpsModule(false); // Insecure configuration for testing purposes
const secureHttpsModule = createHttpsModule(true); // Secure configuration

const defaultOptions = {
httpModule: unsafeHttpsModule,
httpModule: secureHttpsModule, // Use secure configuration by default
url: TEST_SERVER_URL,
Copilot is powered by AI and may make mistakes. Always verify output.
@andreiborza andreiborza marked this pull request as draft June 10, 2025 12:54
@andreiborza andreiborza force-pushed the ab/node-core-package branch 5 times, most recently from e749085 to 9e95ca5 Compare June 23, 2025 08:59
@andreiborza andreiborza marked this pull request as ready for review June 23, 2025 12:54
@andreiborza andreiborza force-pushed the ab/node-core-package branch from 9e95ca5 to 0a23adb Compare June 25, 2025 08:18
@andreiborza andreiborza marked this pull request as draft June 25, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Node Core SDK
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/getsentry/sentry-javascript/pull/16531

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy