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
The last line in the function should be a call to next() (right after the line shown)
When I do roughly something like this...
const httpContext = require('express-http-context')
app.use(httpContext.middleware)
app.use(() => {httpContext.set('thing', 'value')})
...
router.put('/', upload.single('file'), myFunction)
...
inside myFunction():
httpContext.get('thing') // undefined, but only when there's a 'file' param in the multipart form...
The text was updated successfully, but these errors were encountered:
Of course if there was a next() call at that location, then your myFunction would never have access to any uploaded files, as busboy would not have the opportunity to recieve the request data and parse the form.
I'm not familiar with that context module and what it is doing to keep the state around. Have you opened an issue in their repo about the state being lost? It seems to be a pretty common issue opened there and I didn't see any regarding multer. If you or that module's author can provide some kind of PR or specific guidence on what to change in multer that would be a big help. It is also possible that it is just a change in that module, but that module's author would know better.
multer/lib/make-middleware.js
Line 176 in 63f4874
The last line in the function should be a call to
next()
(right after the line shown)When I do roughly something like this...
The text was updated successfully, but these errors were encountered: