mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
8c6157aa46
A handler behind express.json() is reached from the request stream's 'end' event, long after the correlation middleware returned, so it looked as if every write lost its id. It does not: raw-body and multer bind their callbacks with AsyncResource at the point they are called, which is inside the request's correlation. Nothing tested that, though, because every REQID case was a GET. REQID-007 posts a JSON body and REQID-008 one that arrives in several chunks, and both expect the handler to see the id the response carries. The middleware comment now says why this holds.