[REQUIRED] Environment info
firebase-tools: 9.1.0
Platform: macOS
[REQUIRED] Test case
- Create a project that uses hosting and functions.
- Call a function from hosting by rewrites.
- When you test on local emulator, the function cannot get user's User-Agent.
The reproducible sample is below.
https://github.com/dora1998/firebase-tools-ua-example
[REQUIRED] Steps to reproduce
git clone https://github.com/dora1998/firebase-tools-ua-example.git
yarn install && yarn serve --project YOUR_PROJECT_ID
- Access to
http://localhost:5001/YOUR_PROJECT_ID/us-central1/checkUA, then you'll see your user agent.
- However, when you access to http://localhost:5000/foobar, you'll see
FirebaseCLI/9.1.0 regardless of your User-Agent.
I think this line set the User-Agent regardless of user's one.
https://github.com/firebase/firebase-tools/blob/master/src/apiv2.ts#L203
[REQUIRED] Expected behavior
Functions can get user's UA.
[REQUIRED] Actual behavior
Functions always get FirebaseCLI/9.1.0 as User-Agent on local emulator.