Skip to content

Conversation

@marco-ippolito
Copy link
Contributor

@marco-ippolito marco-ippolito commented Jan 14, 2026

Followup of #1240

Description:
This change makes the mirror usable.
Right now Immagine we setup the value of mirror-token to foo.
In this line the value is used as

headers['Authorization'] = `Bearer ${this.nodeInfo.mirrorToken}`;

Bearer foo but in other places such as:

this.nodeInfo.mirrorToken

this.nodeInfo.mirrorToken

its used as is.

But if we change the value to Bearer foo,

headers['Authorization'] = `Bearer ${this.nodeInfo.mirrorToken}`;

here it becomes Bearer Bearer foo which is incorrect, but works everywhere else.

So this PR makes it that if its a Bearer, the user needs to be explicit.

Related issue:
Add link to the related issue.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@marco-ippolito marco-ippolito requested a review from a team as a code owner January 14, 2026 16:01
Copilot AI review requested due to automatic review settings January 14, 2026 16:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an inconsistency in how the mirror-token is used across the codebase. Previously, the token was hardcoded with a "Bearer" prefix in one location (getNodeJsVersions method) but used as-is in all other locations (downloadTool calls). This inconsistency made the mirror feature unusable because users had to choose between making one call work or the others. The fix removes the hardcoded "Bearer" prefix, requiring users to explicitly include the authentication scheme in their token if needed.

Changes:

  • Removed hardcoded "Bearer" prefix from Authorization header in getNodeJsVersions method
  • Updated compiled distribution file to reflect source changes

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/distributions/base-distribution.ts Removes "Bearer" prefix from Authorization header to make token usage consistent
dist/setup/index.js Compiled distribution reflecting the source change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant