Support uppercase *_PROXY env vars.
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 716
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 10
Description
PR #1243 introduced proxy support, but only supports _lowercase_ environment variables. This is a non-issue on windows given https://github.com/nodejs/node/issues/9157, but not on *nix. It doesn't account for the common use case of _uppercase_ environment variables.
View the relevant source at https://github.com/grpc/grpc-node/blob/%40grpc/grpc-js%400.7.0/packages/grpc-js/src/http_proxy.ts#L45-L56
### Solution:
Support both uppercase and lowercase environment variables, i.e. cross-platform case-insensitivity for `grpc_proxy`, `https_proxy`, `http_proxy`, `no_grpc_proxy`, and `no_proxy`.
### Alternative Solution:
Documenting that the grpc client only accepts lowercase env vars, and that their case sensitivity is governed by nodejs itself.
### Additional references:
The popular `get-proxy` package (e.g. used by `got`, via the recommended `caw`), explicitly supports both uppercase and lowercase env vars. As an aside, it also supports equivalent `npm-config` keys of `https-proxy`, `http-proxy`, and `proxy`, despite this being a different concern altogether (npm vs application). See https://github.com/kevva/get-proxy/blob/v2.1.0/index.js#L5-L8
GNU Emacs mentions case-insensitivity in their manual: https://www.gnu.org/software/emacs/manual/html_node/url/Proxies.html
> The library recognizes such variables in either upper or lower case.
Contributor guide
Assessment
This issue has not been assessed yet.