Skip to content

Conversation

@tobil4sk
Copy link

@tobil4sk tobil4sk commented Jan 3, 2026

See: #2226

This solves the root cause of the bug, but for tool-cache to work correctly, the tool-cache's http-client version needs to be updated with this patch.

URL constructor parameter documentation can be found here:
https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#parameters

Ensures that the relative redirect location is relative to the previous
url, not the original url.
@tobil4sk tobil4sk requested a review from a team as a code owner January 3, 2026 14:15
Copilot AI review requested due to automatic review settings January 3, 2026 14:15
Copy link
Contributor

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 a bug in the HTTP client where relative redirects would fail. The fix provides a base URL to the URL constructor when parsing redirect URLs, allowing it to correctly resolve relative paths.

  • Adds base URL parameter to URL constructor for redirect URL parsing
  • Adds comprehensive test coverage for relative redirect scenarios

Reviewed changes

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

File Description
packages/http-client/src/index.ts Fixed URL constructor call to handle relative redirects by passing the current URL as base
packages/http-client/tests/basics.test.ts Added two new test cases for relative redirects and chained redirects with hostname changes

💡 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