Skip to content

url is used instead of originalUrl in http-foramtters helper functions #114

@blue-int

Description

@blue-int

I used morgan with ecsFormat to record http requests in elasticsearch, but the url field is not accurate.

app.use("/base", router);
router.get("/:service", (req, res, next) => {...})

In this example, req.url is /:service and req.originalUrl is /base/:service, because req.url is changed when the router is mounted to /base. formatHttpRequest helper function uses req.url when formatting url, so that baseUrl is ignored. It should use req.originalUrl instead of req.url.

Metadata

Metadata

Assignees

Labels

agent-nodejsMake available for APM Agents project planning.bugSomething isn't workingcommunity

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions