首页 > 解决方案 > 带有 Spring Boot 2.3.0 的 Hoxton.SR6 导致奇怪的内容类型问题

问题描述

当我将我的 Spring Boot 2.3.0.RELEASE 应用程序从 Hoxton.SR4 更新到 Hoxton.SR6(唯一的变化)时,我开始面临来自各种端点的 Content Type 的奇怪问题。

例如,对于 Hoxton.SR4,任何未经授权的端点都会返回此错误:

{
   "error": "unauthorized",
   "error_description": "Full authentication is required to access this resource"
}

Hoxton.SR6 中的相同授权服务器错误来自 XML

<UnauthorizedException>
     <error>unauthorized</error>
     <error_description>Full authentication is required to access this resource</error_description>
</UnauthorizedException>

许多其他端点以 XML 而不是 application/json 返回内容。

有人可以帮助修复 Spring Cloud Hoxton.SR6 的默认内容类型吗?

标签: spring-cloud

解决方案


推荐阅读