Skip to content

[Bug/错误]: 转发了hop-by-hop请求头导致上游渠道报错 #1452

@CashinChen

Description

@CashinChen

Pre-submission Checklist / 提交前检查

  • I have searched the existing issues and this bug has not been reported / 我已搜索现有 issues,此 Bug 尚未被报告
  • I have read the documentation / 我已阅读文档
  • I am using the latest version of AxonHub / 我正在使用 AxonHub 的最新版本

Bug Description / Bug 描述

转发请求到上游渠道时
即使关闭请求透传,也会附带Upgrade等hop-by-hop请求头
这些请求头未被过滤掉,导致转发到渠道的请求失败

Steps to Reproduce / 复现步骤

1:本地使用agentscope-java框架调用axonhub的openai、anthropic的普通http端点,http请求头带有Upgrade: h2c
2:axonhub转发到https的渠道,即使把透传请求体关掉,也会把客户端传来的Upgrade: h2c请求头也带上,https不支持Upgrade: h2c 导致报错(https是tls加密的http2, h2c是不带tls加密的http2。存在根本上冲突)

Image

Expected Behavior / 期望行为

转发时不应该将hop-by-hop请求头一并转发,应由axonhub的http客户端自己决定这些请求头。

Error Message / 错误消息

Operating System / 操作系统

Linux (Ubuntu/Debian) / Linux(Ubuntu/Debian)

AxonHub Version / AxonHub 版本

v0.9.35

Usage Scenario / 使用场景

Other / 其他

API Format / API 格式

OpenAI - Chat Completions (/v1/chat/completions) / OpenAI 聊天补全

Channel Type / 渠道类型

OpenAI / OpenAI

Logs / 日志

Additional Context / 其他补充信息

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions