kir*_*gin 8 spring spring-mvc kotlin spring-boot
Spring Web 堆栈上有一个应用程序。升级到最新版本后,我遇到了一个不寻常的问题Spring Boot 2.6.1。
下面的代码
@RestController
@RequestMapping("sample")
class SampleController {
@PostMapping
fun doSomething(@RequestBody body: Any): Any {
error("Error!")
}
}
Run Code Online (Sandbox Code Playgroud)
用于在早期版本中产生以下错误
{
"timestamp": "2020-05-27T13:44:58.032+00:00",
"status": 500,
"error": "Internal Server Error",
"message": "Error!",
"path": "/sample"
}
Run Code Online (Sandbox Code Playgroud)
但升级后整个响应体是空的。不是message可以通过server.error.inclide-message: always标志设置来固定的字段,而是整个主体。该include-binding-errors: always标志也没有效果。
我在 Spring Boot 变更日志中没有发现有关该行为的注释
看看这个问题:https ://github.com/spring-projects/spring-boot/issues/28953
如果您允许访问/errorSecurityConfig 中的白标页面,它应该会再次工作。然而,这似乎是一个解决方法,因为问题仍在进行中。
所以这是2.6.0和2.6.1版本中的一个bug。2.6.2 中已修复
| 归档时间: |
|
| 查看次数: |
4166 次 |
| 最近记录: |