Closed blue-int closed 1 year ago
Any progress on this? I have the same problem...
Thank you for the issue and my apologies for the delay.
https://expressjs.com/en/4x/api.html#req.originalUrl
When using Express, this library needs to prefer req.originalUrl
because Express overwrites req.url
during its routing.
I used morgan with ecsFormat to record http requests in elasticsearch, but the url field is not accurate.
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.