-
Notifications
You must be signed in to change notification settings - Fork 539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default "user-agent" from undici
#2306
Comments
I'm 👍 for this change. Undici should maybe be dynamic and still return |
I'd rather have User-Agent be opt-in, but at the very least it should not contain version information. |
What would the opt-in mechanism be? I also agree -- for lower level http apis. Fetch is high-enough level that I believe its okay to be making default decisions like user-agent header. |
spec-wise we have to add a user-agent header. |
Keep in mind, it's already there, its value is just confusing. What would be the argument for not adding a version number? Most clients I can think of has one. 🤔 |
At least for security reasons. |
Keep in mind that browsers are actually removing info from the user agent headers, for the reason mentioned above. https://developer.chrome.com/blog/user-agent-reduction-android-model-and-version/ |
Node/version
undici
I'm +1 to changing it to simply |
Based on the way browsers are going let's settle on switching it to |
I don't have an opinion, anything is fine with me |
I would rather not have one, but the spec mandate us. Who wants to do the honors? |
On it 🚀 |
What is the problem this feature will solve?
Currently, Node.js uses
undici
for itsfetch
implementation. This setsundici
as the default user agent.From Node.js' perspective,
undici
is an implementation detail and so it should have its own user agent header.For context at Next.js, we stopped polyfilling
globalThis.fetch
in favor of the platform-provided alternative (previously usingnode-fetch
), and started getting reports where users did not know where the requests with theundici
user agent were coming from.I've tested the current behavior in different runtimes, here is Node.js, Bun and Deno for comparison:
node node.mjs
prints: undici:bun bun.js
prints: Bun/1.0.2:deno run --allow-net deno.js
prints: Deno/1.37.1:What is the feature you are proposing to solve the problem?
I propose that the default user agent in Node.js changes to the format used by Deno, and Bun for consistency.
Example:
Node/18.18.0
What alternatives have you considered?
Related: nodejs/node#43852 nodejs/node#43851
The text was updated successfully, but these errors were encountered: