[config] Add option for changing max payload size on requests sent to server. Closes #5775.

This commit is contained in:
Jonathan Budzenski 2015-12-29 11:25:30 -06:00
parent a42f29fe23
commit 642d4d6afa
3 changed files with 8 additions and 1 deletions

View file

@ -8,6 +8,9 @@
# specify that path here. The basePath can't end in a slash.
# server.basePath: ""
# The maximum payload size in bytes on incoming server requests.
# server.maxPayloadBytes: 1048576
# The Elasticsearch instance to use for all your queries.
# elasticsearch.url: "http://localhost:9200"

View file

@ -28,6 +28,7 @@ module.exports = () => Joi.object({
server: Joi.object({
host: Joi.string().hostname().default('0.0.0.0'),
port: Joi.number().default(5601),
maxPayloadBytes: Joi.number().default(1048576),
autoListen: Joi.boolean().default(true),
defaultRoute: Joi.string(),
basePath: Joi.string().default('').allow('').regex(/(^$|^\/.*[^\/]$)/, `start with a slash, don't end with one`),

View file

@ -20,7 +20,10 @@ module.exports = function (kbnServer, server, config) {
strictHeader: false
},
routes: {
cors: config.get('server.cors')
cors: config.get('server.cors'),
payload: {
maxBytes: config.get('server.maxPayloadBytes')
}
}
};