I've noticed that if I submit a form with enctype="multipart/form-data"
that has a hidden _method input set to PUT
the methodOverride function will not fire, resulting in a 404 POST
for that route.
The set up:
app.use(express.json());
app.use(express.urlencode());
...
app.use(express.methodOverride());
app.use(express.router());
app.put('/update', express.multipart(), function(req, res) { ... });
if i change put to post in the router everything works just fine. Also put and delete work in other routes that do not have enctype="multipart/form-data"
sent to them.
I tried changing the order of the middleware but no luck with that.
Any help would be highly appreciated, since googling this issue resulted in nothing!
Thanks in advance!