Repository navigation
fix: support lowercase http_proxy/https_proxy/no_proxy env vars - #856
Open
Zephyr-Song wants to merge 1 commit into
Open
Zephyr-Song wants to merge 1 commit into
Zephyr-Song wants to merge 1 commit into
Conversation
plugin_daemon only read HTTP_PROXY/HTTPS_PROXY/NO_PROXY from the environment. Many setups (and docker-compose) export the lowercase variants, so the proxy was silently ignored behind an HTTP(S) proxy, breaking marketplace plugin installation. ApplyProxyEnvFallback() now fills the uppercase fields from their lowercase counterparts when the uppercase value is empty, preserving uppercase precedence. Called from the server, migrate and cleanup config load paths. Refs langgenius/dify#18752
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
plugin_daemononly readHTTP_PROXY/HTTPS_PROXY/NO_PROXYfrom the environment (via theenvconfigtags ininternal/types/app/config.go). Many environments — includingdocker-compose.yamlenvironment:blocks and most Linux/macOS shells — export the lowercasehttp_proxy/https_proxy/no_proxyvariants. When only the lowercase form was set, the proxy was silently ignored, so plugin_daemon could not reach the marketplace behind an HTTP(S) proxy (see langgenius/dify#18752).What changed
Config.ApplyProxyEnvFallback(), which fills the uppercase proxy fields from their lowercase counterparts only when the uppercase value is empty, preserving uppercase precedence.envconfig.Process(...)in the three config load paths:cmd/server/main.go,cmd/commandline/migrate.go, andcmd/commandline/plugin/cleanup.go.internal/types/app/config_test.gocovering: lowercase fallback, uppercase precedence, and leave-as-is when already set.Test plan
go test ./internal/types/app/... -run TestApplyProxyEnvFallbackRelated