You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After jump from previous version (0.1...0.2) to 1.0 i found that my REQ object isn't logged anymore...
Digger into the code, i found that the expected shape of the req object (IncomingMessage) is now: req -> raw-> req , and other frameworks, like fastify, expose that at req -> raw directly.
I have a fix to support this (and possibly others (?) frameworks), let me know to send PR.
thx
The text was updated successfully, but these errors were encountered:
nicomf1982
changed the title
Support for other frameworks that not expose raw req at req.raw.req
Support for other frameworks that not expose raw request at req.raw.req
Apr 15, 2021
@nicomf1982 Thanks for the issue. My apologies for never having replied. I understand if you have moved on by now.
If this is still relevant to you, I would like to discuss it now and look into a fix.
I believe the code block you are referring to is this:
if(req.raw&&req.raw.req&&req.raw.req.httpVersion){// This looks like a hapi request object (https://hapi.dev/api/#request),// use the raw Node.js http.IncomingMessage that it references.// TODO: Use hapi's already parsed `req.url` for speed.req=req.raw.req}
This was added to support @hapi/hapi.
My expectation is that this would not have broken usage for Fastify, which has req.raw (https://fastify.dev/docs/latest/Reference/Request/) ... unless I am mistaken and req.raw.req is actually truthy. The repo does not have a specific test case for Fastify, however. I will look into adding one.
Hello guys:
After jump from previous version (0.1...0.2) to 1.0 i found that my REQ object isn't logged anymore...
Digger into the code, i found that the expected shape of the req object (IncomingMessage) is now: req -> raw-> req , and other frameworks, like fastify, expose that at req -> raw directly.
I have a fix to support this (and possibly others (?) frameworks), let me know to send PR.
thx
The text was updated successfully, but these errors were encountered: