mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 10:01:55 +00:00
Increase max payload size in bodyparser to avoid PayloadTooLarge errors
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
58fa0ac761
commit
c9507e013c
@ -867,8 +867,8 @@ export class APIBinder {
|
||||
private createAPIBinderRouter(apiBinder: APIBinder): express.Router {
|
||||
const router = express.Router();
|
||||
|
||||
router.use(bodyParser.urlencoded({ extended: true }));
|
||||
router.use(bodyParser.json());
|
||||
router.use(bodyParser.urlencoded({ limit: '10mb', extended: true }));
|
||||
router.use(bodyParser.json({ limit: '10mb' }));
|
||||
|
||||
router.post('/v1/update', (req, res) => {
|
||||
apiBinder.eventTracker.track('Update notification');
|
||||
|
@ -51,8 +51,8 @@ fetchAction = (service) ->
|
||||
# Some v1 endpoins only work for single-container apps as they assume the app has a single service.
|
||||
createApplicationManagerRouter = (applications) ->
|
||||
router = express.Router()
|
||||
router.use(bodyParser.urlencoded(extended: true))
|
||||
router.use(bodyParser.json())
|
||||
router.use(bodyParser.urlencoded({ extended: true, limit: '10mb' }))
|
||||
router.use(bodyParser.json({ limit: '10mb' }))
|
||||
|
||||
createV1Api(router, applications)
|
||||
createV2Api(router, applications)
|
||||
|
@ -48,8 +48,8 @@ validateState = Promise.method (state) ->
|
||||
# device api stuff in ./device-api
|
||||
createDeviceStateRouter = (deviceState) ->
|
||||
router = express.Router()
|
||||
router.use(bodyParser.urlencoded(extended: true))
|
||||
router.use(bodyParser.json())
|
||||
router.use(bodyParser.urlencoded(limit: '10mb', extended: true))
|
||||
router.use(bodyParser.json(limit: '10mb'))
|
||||
|
||||
rebootOrShutdown = (req, res, action) ->
|
||||
deviceState.config.get('lockOverride')
|
||||
|
@ -71,8 +71,8 @@ formatCurrentAsState = (device) ->
|
||||
createProxyvisorRouter = (proxyvisor) ->
|
||||
{ db } = proxyvisor
|
||||
router = express.Router()
|
||||
router.use(bodyParser.urlencoded(extended: true))
|
||||
router.use(bodyParser.json())
|
||||
router.use(bodyParser.urlencoded(limit: '10mb', extended: true))
|
||||
router.use(bodyParser.json(limit: '10mb'))
|
||||
router.get '/v1/devices', (req, res) ->
|
||||
db.models('dependentDevice').select()
|
||||
.map(parseDeviceFields)
|
||||
|
Loading…
x
Reference in New Issue
Block a user