Skip to content
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

Empty user agent (Fetch API) #76

Closed
bajtos opened this issue Feb 28, 2023 · 0 comments · Fixed by #224
Closed

Empty user agent (Fetch API) #76

bajtos opened this issue Feb 28, 2023 · 0 comments · Fixed by #224
Assignees
Labels
bug 🐛 Something isn't working

Comments

@bajtos
Copy link
Member

bajtos commented Feb 28, 2023

When making Fetch API request, zinnia should report the runtime version and module name in the user agent.

IMO, the user agent string should be hard-coded, and modules should not be able to change it. At least not until we have very good reasons to allow them to do so.

At the moment, the user agent header is empty:

{
  "accept": "*/*",
  "accept-language": "*",
  "user-agent": "",
  "accept-encoding": "gzip, br",
  "host": "localhost:3000"
}

Echo HTTP server in Node.js:

require('http').createServer((req, res) => {
  res.write(JSON.stringify(req.headers, null, 2));
  res.end();
}).listen(3000)

Zinnia module making the request and producing the output shown at the top:

console.log(
  await (await fetch('http://localhost:3000/')).text()
);

Estimate: 1 day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
Status: ✅ done
Development

Successfully merging a pull request may close this issue.

1 participant