Closed arnaugm closed 9 years ago
What version of winston-express
are you using?
I just created this example from scratch to check that the issue was not fixed yet, so I used the 0.2.9. In another project I was using 0.2.8 and I had the same problem.
Yup. I believe that my PR will fix it, so it's up to @bithavoc to pull the trigger on the merge.
Publishes to NPM as 0.2.11
0.2.11 corrects the crash, but the body field is empty. In the previous example, the body should be 'Hello World!'
info: HTTP GET / url=/, host=localhost:3000, connection=keep-alive, cache-control=max-age=0, accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8, user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/39.0.2171.65 Chrome/39.0.2171.65 Safari/537.36, accept-encoding=gzip, deflate, sdch, accept-language=en-US,en;q=0.8,ca;q=0.6,es;q=0.4, if-none-match="472456355", method=GET, httpVersion=1.1, originalUrl=/, , body=undefined, statusCode=304, body=, responseTime=2
can't see the content type of the request @arnaugm
see this: https://github.com/itagenten/express-winston/commit/c2f2ba944269bb2a9d3ba1e8a18916ee0c6fe038
Sorry @bithavoc I don't understand your question.
@arnaugm I don't see the content type of the request, is it there in the headers?
Not sure what you mean. My point is that with the example above I think it should work, Am I wrong? If the content type is not specified, the default one should be taken into account and in any case return the content of the body.
This problem should be fixed in 2.11 (newest version) - the behaviour you describe is what now happens.
Seems to work now, great!
Cool. :)
I'm trying to log the body of the response and apparently the lib crashes when trying to get it from the headers.
Simple example app:
Accessing the defined route results in a crash