openfoodfacts / openfoodfacts-nodejs

Official Node package for Open Food Facts
https://openfoodfacts.github.io/openfoodfacts-nodejs/
Apache License 2.0
148 stars 27 forks source link

feat: add USER_AGENT constant and include it in API request headers #559

Closed bengeois closed 2 weeks ago

bengeois commented 2 weeks ago

What

This pull request introduces the USER_AGENT constant and integrates it all API client classes to standardize the user agent used in HTTP requests.

Note that there may be a change in the future to request a mandatory user-agent with this issue https://github.com/openfoodfacts/openfoodfacts-nodejs/issues/310

VaiTon commented 2 weeks ago

@bengeois just a thought, can we add the package.json version somehow?

bengeois commented 2 weeks ago

@VaiTon I was hesitating, it can be a good thing to add it as well, yes. I've made an update with a proposal to include it

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud