Closed dennypradipta closed 4 months ago
Still verifying whether if the Docker version uses the custom user agent.
I just remembered Monika has getContext().userAgent
. The value is @hyperjumptech/monika/1.20.2 (darwin-x64) node-20.11.0
.
I just remembered Monika has
getContext().userAgent
. The value is@hyperjumptech/monika/1.20.2 (darwin-x64) node-20.11.0
.
Thanks for the tip! It works flawlessly
Docker
NPM
Here is the example for using custom user agent
Monika Pull Request (PR)
What feature/issue does this PR add
This PR adds custom user agent when probing websites, and will fixes #1292
How did you implement / how did you fix it
How to test
const fastify = Fastify({ logger: { serializers: { req(req) { console.log(req.headers["user-agent"]);
}, });
// Declare a route fastify.get("/", async function handler(request, reply) { return { hello: "world" }; });
// Run the server! try { await fastify.listen({ port: 3000 }); } catch (err) { fastify.log.error(err); process.exit(1); }