@nxtedition/lib 23.7.2 → 23.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/http.js +4 -2
- package/package.json +1 -1
package/http.js
CHANGED
|
@@ -624,7 +624,9 @@ export async function request(ctx, next) {
|
|
|
624
624
|
req.resume() // Dump the body if there is one.
|
|
625
625
|
}
|
|
626
626
|
|
|
627
|
-
|
|
627
|
+
if (req.id) {
|
|
628
|
+
res.setHeader('request-id', req.id)
|
|
629
|
+
}
|
|
628
630
|
|
|
629
631
|
const isHealthcheck = ctx.url.pathname === '/healthcheck' || ctx.url.pathname === '/_up'
|
|
630
632
|
|
|
@@ -726,7 +728,7 @@ export function createServer(options, ctx, middleware) {
|
|
|
726
728
|
middleware = Array.isArray(middleware) ? middleware : [middleware]
|
|
727
729
|
middleware = fp.values(middleware)
|
|
728
730
|
middleware = middleware.flat().filter(Boolean)
|
|
729
|
-
middleware = compose([
|
|
731
|
+
middleware = compose([requestMiddleware, ...middleware])
|
|
730
732
|
|
|
731
733
|
const server = http.createServer(
|
|
732
734
|
{
|