(req, res, next)
| 435 | } |
| 436 | |
| 437 | export function allowMethodOverride(req, res, next) { |
| 438 | if (req.method === 'POST' && req.body?._method) { |
| 439 | if (typeof req.body._method === 'string') { |
| 440 | req.originalMethod = req.method; |
| 441 | req.method = req.body._method.toUpperCase(); |
| 442 | } |
| 443 | delete req.body._method; |
| 444 | } |
| 445 | next(); |
| 446 | } |
| 447 | |
| 448 | async function resolveKeyAuth({ config, keyValue, maintenanceKeyValue, installationId, clientIp }) { |
| 449 | if (maintenanceKeyValue && maintenanceKeyValue === config.maintenanceKey) { |