-
Notifications
You must be signed in to change notification settings - Fork 825
Closed
Description
复现方法
在microservice.yaml配置servicecomb.rest.server.maxFormAttributeSize=500, 写一个接收String类型表单参数的接口, 传递超过500字节的参数.
在 Java-Chassis 1.3.8 版本, 得到的错误响应是 500 状态码, body为 {"message":"java.io.IOException: Size exceed allowed maximum capacity"}. 而在 2.8.2 版本, 得到的错误响应是 500 状态码, body为 {"message":"Internal Server Error"}.
根因
两个版本都是Netty的AbstractHttpData.checkSize方法检测到 form 表单参数超限, 抛出 IOException, 异常传递到 org.apache.servicecomb.transport.rest.vertx.VertxRestDispatcher#sendExceptionByRoutingContext 方法转换成 HTTP response 返回.
不同之处在于, 2.8.2 版本的这个方法不会调用 e.getMessage() 获取异常的错误信息, 设置到 body 中.
不确定这里是不是为了安全原因做的修改, 能否优化一下, 让报错更清晰呢?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels