Skip to content

修复 FetchTask 不遵循代理设置的问题#4596

Merged
Glavo merged 1 commit intoHMCL-dev:mainfrom
Glavo:proxy
Oct 4, 2025
Merged

修复 FetchTask 不遵循代理设置的问题#4596
Glavo merged 1 commit intoHMCL-dev:mainfrom
Glavo:proxy

Conversation

@Glavo
Copy link
Copy Markdown
Member

@Glavo Glavo commented Oct 3, 2025

No description provided.

Copilot AI review requested due to automatic review settings October 3, 2025 14:17
Copy link
Copy Markdown
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 an issue where FetchTask doesn't respect proxy settings by implementing lazy initialization of the HTTP client. The key change moves the HTTP_CLIENT initialization from static class loading time to on-demand initialization via a holder pattern.

  • Moved HTTP_CLIENT from static field to lazy-initialized holder class
  • Changed HTTP_CLIENT reference to use Holder.HTTP_CLIENT pattern
  • Added documentation explaining the initialization timing requirement

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@HMCL-dev HMCL-dev deleted a comment from Copilot AI Oct 3, 2025
@HMCL-dev HMCL-dev deleted a comment from Copilot AI Oct 3, 2025
@Glavo Glavo merged commit 2e09a40 into HMCL-dev:main Oct 4, 2025
2 checks passed
@Glavo Glavo deleted the proxy branch October 4, 2025 13:11
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.

2 participants