Skip to content

@sentry/node v7.46.0 affects got github responses #7724

Closed
@avaly

Description

@avaly

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/node

SDK Version

7.46.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: process.env.SENTRY_DSN
});

Steps to Reproduce

  1. Use node.js v18
  2. Add got v11.8.0 (pre ESM versions)
  3. Initialize Sentry v7.46.0
  4. Make a Github API request for a private repository with got (the private repository part is important - public repositories are not affected)
const Sentry = require('@sentry/node');
const got = require('got');

(async () => {
  Sentry.init({
    dsn: process.env.SENTRY_DSN
  });

  try {
    const response = await got('https://api.github.com/repos/OWNER/REPO/commits?per_page=1', {
      password: process.env.GITHUB_TOKEN
    })
    console.log(response.body);
  } catch (err) {
    console.error(err);
  }
})();

Downgrading @sentry/node to 7.45.0 makes the result expected.

Expected Result

We get a 200 response back from got.

Actual Result

We get a 404 response back from got.

Metadata

Metadata

Assignees

Labels

Package: nodeIssues related to the Sentry Node SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions