Set own default UserAgent
See original GitHub issueIf i want to use my own user-agent on every request i am doing with node-fetch i currently have to add the header every time i use fetch. In my opinion there should be a possibility to set a global default user-agent because the user-agent is always static for the lifetime of the application (or not?) and setting it every time is a unnecessary overhead.
Something like:
fetch.setDefaultUserAgent('myApp/1.0.1 (MYSERVER; Linux) node-fetch');
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:14
Top Results From Across the Web
How to reset the default user agent on Firefox - Mozilla Support
Learn how to reset your Firefox "user agent" so that websites can detect your correct browser and version and work the way they...
Read more >How to Change User-Agents in Chrome, Edge, Safari & Firefox
3. Navigate to Develop > User-Agent ... You can again select from a predefined list or enter custom user-agent string by choosing “Other…”...
Read more >How can I permanently change the default user agent in ...
In edge, I can change the default user agent in Chrome. I can do the following right now: In Edge, select More Tools->Developer...
Read more >How to Change User-Agent in Chrome, Firefox, Safari, and more
To undo the user-agent change, you will have to return to the same Develop menu and select Default in the User Agent option....
Read more >How to change your user agent for Firefox
How to change your user agent in Firefox · Open a new tab · Browse to "about:config" · Dismiss the warning · Create...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
easies thing you could do right now is maybe to just build a own wrapper around node-fetch
Probably we did not understand each other. The documentation says, that if I don’t provide
headers
parameter, it will be generated automatically and will include ‘Accept’, ‘Content-Length’, … headers.It is not clear, what happens if I provide ‘User-Agent’ header only. Will it still add
Accept
,Content-Length
, … headers or not. According to the source code, it will changeUser-Agent
and still generate other headers (Accept
,Content-Length
). That’s what I expected. Sorry for that misunderstanding