Skip to content

Schema-less HTTP_PROXY and HTTPS_PROXY env vars should maybe assume http #4736

@williammartin

Description

@williammartin

This would solve...

Currently, I'm working on gh and copilot CLIs, and we use undici in the latter. We had a report that gh supported schema-less HTTP_PROXY (e.g. HTTP_PROXY=localhost:9000 gh ...) but copilot did not.

When I looked into this, I saw that the EnvHttpProxyAgent passes the env vars verbatim to the underlying client. However, in Go, which gh is written in the proxy env var behaviour is as follows:

The environment values may be either a complete URL or a "host[:port]", in which case the "http" scheme is assumed. An error is returned if the value is a different form.

I'm not sure whether this is behavior you really want, since it may be surprising, but I thought I'd bring it to your attention with a point of comparison for your consideration. Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions