vapor功能绝大多数是通过注册service来实现注入,而form表单系统有默认的最大上限:maxBodySize
maxBodySize
equests with bodies larger than this maximum will be rejected. Streaming bodies, like chunked bodies, ignore this maximum.
我们可以重新的自己去注册服务来实现自定义最大上限:
//configure.swift func configure
var nioServerConfig = NIOServerConfig.default()
//修改为 4MB
nioServerConfig.maxBodySize = 4 * 1024 * 1024
services.register(nioServerConfig)
网友评论