You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Integration因HTTP/2新Priority请求头验证失败的修复咨询

Chrome 124 + Spring Integration 请求验证失败问题解决方案

问题说明

Chrome升级至Chromium 124版本后,HTTP/2和HTTP/3请求会默认携带新格式的Priority请求头,值为字符串类型(例如u=5, i)。但Spring Integration的spring-integration-core包中,IntegrationMessageHeaderAccessor类的verifyType方法会强制验证该头的值必须为数字类型,导致请求验证失败。

官方补丁状态

Spring Integration已针对该问题发布官方修复:

  • 调整了Priority头的类型校验逻辑,允许字符串格式的优先级值通过验证
  • 修复已包含在Spring Integration 6.2.1、6.1.7、5.5.24及后续版本中
  • 直接升级到对应版本即可彻底解决问题

临时缓解方案(未升级前)

若暂时无法升级依赖,可通过拦截请求过滤掉Priority头作为临时修复:

// 示例:Spring MVC拦截器实现头过滤
public class PriorityHeaderFilter implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if (request instanceof HttpServletRequestWrapper) {
            ((HttpServletRequestWrapper) request).removeHeader("Priority");
        }
        return true;
    }
}

内容的提问来源于stack exchange,提问作者Kevin Yap

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.25 05:39:56