Adds maxBytes and accepts options for workpad api routes that need it (#52189)

This commit is contained in:
Corey Robertson 2019-12-16 15:34:05 -05:00 committed by GitHub
parent 7e67d1f86c
commit e6a0684469
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -24,6 +24,12 @@ export function initializeCreateWorkpadRoute(deps: RouteInitializerDeps) {
validate: {
body: WorkpadSchema,
},
options: {
body: {
maxBytes: 26214400,
accepts: ['application/json'],
},
},
},
catchErrorHandler(async (context, request, response) => {
if (!request.body) {

View file

@ -64,6 +64,12 @@ export function initializeUpdateWorkpadRoute(deps: RouteInitializerDeps) {
}),
body: WorkpadSchema,
},
options: {
body: {
maxBytes: 26214400,
accepts: ['application/json'],
},
},
},
catchErrorHandler(async (context, request, response) => {
return workpadUpdateHandler(
@ -84,6 +90,12 @@ export function initializeUpdateWorkpadRoute(deps: RouteInitializerDeps) {
}),
body: WorkpadSchema,
},
options: {
body: {
maxBytes: 26214400,
accepts: ['application/json'],
},
},
},
catchErrorHandler(async (context, request, response) => {
return workpadUpdateHandler(
@ -111,6 +123,12 @@ export function initializeUpdateWorkpadAssetsRoute(deps: RouteInitializerDeps) {
// unknowns and then validate in the handler
body: schema.object({}, { allowUnknowns: true }),
},
options: {
body: {
maxBytes: 26214400,
accepts: ['application/json'],
},
},
},
async (context, request, response) => {
return workpadUpdateHandler(