Skip to content

fix: support lowercase http_proxy/https_proxy/no_proxy env vars - #856

Open
Zephyr-Song wants to merge 1 commit into
langgenius:mainfrom
Zephyr-Song:fix/proxy-env-lowercase-fallback
Open

Zephyr-Song wants to merge 1 commit into
langgenius:mainfrom
Zephyr-Song:fix/proxy-env-lowercase-fallback

Conversation

@Zephyr-Song

Copy link
Copy Markdown

Summary

plugin_daemon only read HTTP_PROXY / HTTPS_PROXY / NO_PROXY from the environment (via the envconfig tags in internal/types/app/config.go). Many environments — including docker-compose.yaml environment: blocks and most Linux/macOS shells — export the lowercase http_proxy / https_proxy / no_proxy variants. 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

  • Added Config.ApplyProxyEnvFallback(), which fills the uppercase proxy fields from their lowercase counterparts only when the uppercase value is empty, preserving uppercase precedence.
  • Called it right after envconfig.Process(...) in the three config load paths: cmd/server/main.go, cmd/commandline/migrate.go, and cmd/commandline/plugin/cleanup.go.
  • Added unit tests in internal/types/app/config_test.go covering: lowercase fallback, uppercase precedence, and leave-as-is when already set.

Test plan

  • go test ./internal/types/app/... -run TestApplyProxyEnvFallback

Related

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

No deployments
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