fix: Replace axios with fetch in RemoteConfigLoader for HTTP proxy support #10534
+112
−52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
COM-346
Related GitHub Issue
COM-346
Closes: #10453
Description
This PR attempts to address Issue #10453 where marketplace items fail to load when users are behind an HTTP proxy.
The Problem:
RemoteConfigLoader.tswas using axios without proxy configuration, which requires manualhttpsAgentsetup to work in proxy environments.The Solution: As suggested by @44010083 in the issue discussion, I replaced axios with the native
fetchAPI, which automatically respects VS Code'shttp.proxysettings. This approach:Key Implementation Details:
Test Procedure
Run the unit tests:
Manual testing (for users with proxy environments):
All unit tests pass (22 tests total across both files).
Pre-Submission Checklist
Documentation Updates
Additional Notes
This fix follows the suggestion from @44010083 in the original issue. The native fetch API in VS Code extensions automatically inherits the proxy configuration, making this a much cleaner solution than manually configuring proxy agents.
Feedback and guidance are welcome!
Important
Replaces axios with fetch in RemoteConfigLoader for HTTP proxy support and updates tests accordingly.
axioswithfetchinRemoteConfigLoader.tsto support HTTP proxy settings in VS Code.AbortController.RemoteConfigLoader.spec.tsandMarketplaceManager.spec.tsto mockfetchinstead ofaxios.RemoteConfigLoader.spec.ts.This description was created by
for 44f621c. You can customize this summary. It will automatically update as commits are pushed.