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
All middleware needs to execute next() sooner or later. If a middleware does not execute next() withing a timeout, a warning is logged and the next middleware executed. To change the default of 4seconds to something else use timeout(milliseconds).
Which results in a following error AND incorrect 404 response code:
2024-07-06T06:30:30.395Z [LOG] 127.0.0.1 - GET "/auth/whoami" 404 ""
102 |
103 | this._implicitHeader()
104 | }
105 |
106 | if (!stream) {
107 | return _end.call(this, chunk, encoding)
^
error: write after end
code: "ERR_STREAM_WRITE_AFTER_END"
at new NodeError (node:stream:420:20)
at _write (node:stream:2672:20)
at node:stream:2852:76
at end (/Users/alpharder/dev/kachalka/node_modules/compression/index.js:107:21)
at handleHtmlResponse (/Users/alpharder/dev/kachalka/node_modules/@deepkit/http/dist/esm/src/http.js:720:32)
at handle (/Users/alpharder/dev/kachalka/node_modules/@deepkit/http/dist/esm/src/http.js:3:16)
at /Users/alpharder/dev/kachalka/node_modules/@deepkit/http/dist/esm/src/http.js:800:28
at onResponse (/Users/alpharder/dev/kachalka/node_modules/@deepkit/http/dist/esm/src/http.js:797:16)
It's either should be fixed or it should be stated in the documentation that ending a response at middleware is either not allowed or doesn't require calling next().
Additionally, it's currently not documented what err argument of next() actually does (causes 404 response with empty body). This is also weird, but should at least be documented.
The text was updated successfully, but these errors were encountered:
the timeout was removed. middlewares were added to somewhat support some basic express middlewars like compress, but it was more a hack to get basics working and is not in line with the philosophie of deepkit and thus never fully added support for it, so we actually had the idea to remove it entirely and add some other way to support some useful middlewares. an alternative route could be to find all the rough edges and make it stable enough
It's currently stated at documentation:
This middleware does what is said above:
Which results in a following error AND incorrect 404 response code:
It's either should be fixed or it should be stated in the documentation that ending a response at middleware is either not allowed or doesn't require calling
next()
.Additionally, it's currently not documented what
err
argument ofnext()
actually does (causes 404 response with empty body). This is also weird, but should at least be documented.The text was updated successfully, but these errors were encountered: