Repository navigation
Handle blank proxy environment variables as unset - #85
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: ARAYN7011 <88572149+ARAYN7011@users.noreply.github.com>
|
Thank you, we already have similar code in phoenixframework/tailwind, maybe we can port that version instead to ease maintenance? |
Signed-off-by: ARAYN7011 <88572149+ARAYN7011@users.noreply.github.com>
|
Thanks @josevalim. Ported the tailwind version ( |
| assert Esbuild.NpmRegistry.proxy_for_scheme("http") == nil | ||
| assert Esbuild.NpmRegistry.proxy_for_scheme("https") == nil | ||
| end | ||
|
|
There was a problem hiding this comment.
Let's use a tag for tests:
@tag envs: %{"HTTP_PROXY" => ""}
This way setup knows exactly which tags to set and which ones to reset, instead of traversing the whole environment. It should be faster, simpler, and fewer LOCs!
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Done in ec37942: the tests now use |
Fixes #80
HTTP_PROXY=""(orHTTPS_PROXY="") was treated as a configured proxy, sofetch_package!/2crashed trying to build{host, port}from an empty URI.proxy_for_scheme/1now ignores blank values (and falls back to the lowercase variable), as suggested in the issue.proxy_auth/1uses the same function, so it is fixed too.Test plan:
test/npm_registry_test.exs(3 tests: configured proxy, blank treated as unset, lowercase fallback);mix format --check-formattedclean. The existing tests download esbuild from the network, so I only ran the new file.AI assistance disclosure: this change was written with Claude (Claude Code) and reviewed/tested by me.