firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 929 forks source link

fix:(track.ts) if environment variables were set, use proxy agent. #7218

Open takao-s opened 4 months ago

takao-s commented 4 months ago

Description

Fixed: If you run firebase login behind the proxy server , you will see "Error: An unexpected error has occurred." in your termial after a few seconds, even if you set the environment variables such as HTTP_PROXY. Because track.ts try to fetch to the GA4 without proxy settings.

I fixed track.ts to use proxy-agent when the environment variables such as HTTP_PROXY are set.

Scenarios Tested

I manually tested ...

  1. firebase login behind the proxy with enviroment variables. -> Success
  2. firebase login behind the proxy without enviroment variables. -> Error
  3. firebase login directly connected to the Internet with enviroment variables. -> Error
  4. firebase login directly connected to the Internet without enviroment variables. -> Success

Sample Commands

google-cla[bot] commented 4 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.