mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 17:21:33 +00:00
fix: routes/nojs
This commit is contained in:
parent
3e0aa1361d
commit
abe27b746c
@ -12,7 +12,10 @@ routes.get('/nojs', async (req, res) => {
|
||||
})
|
||||
})
|
||||
|
||||
routes.post('/nojs', async (req, res) => {
|
||||
// HyperExpress defaults to 250kb
|
||||
// https://github.com/kartikk221/hyper-express/blob/6.4.4/docs/Server.md#server-constructor-options
|
||||
const maxBodyLength = parseInt(config.uploads.maxSize) * 1e6
|
||||
routes.post('/nojs', { max_body_length: maxBodyLength }, async (req, res) => {
|
||||
res._json = res.json
|
||||
res.json = (...args) => {
|
||||
const result = args[0]
|
||||
@ -25,10 +28,6 @@ routes.post('/nojs', async (req, res) => {
|
||||
})
|
||||
}
|
||||
return upload.upload(req, res)
|
||||
}, {
|
||||
// HyperExpress defaults to 250kb
|
||||
// https://github.com/kartikk221/hyper-express/blob/6.2.4/docs/Server.md#server-constructor-options
|
||||
max_body_length: parseInt(config.uploads.maxSize) * 1e6
|
||||
})
|
||||
|
||||
module.exports = routes
|
||||
|
Loading…
Reference in New Issue
Block a user