Skip to content

fix(ingress): correct response framing after protocol conversion - #110

Open
Ember-Moth wants to merge 2 commits into
Calcium-Ion:mainfrom
Ember-Moth:codex/fix-response-framing
Open

Ember-Moth wants to merge 2 commits into
Calcium-Ion:mainfrom
Ember-Moth:codex/fix-response-framing

Conversation

@Ember-Moth

@Ember-Moth Ember-Moth commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #108

成功协议转换时清除上游 Content-Length,由 HTTP 服务根据转换后的正文确定消息边界,避免空响应或截断。错误响应仍原样透传。

新增真实 HTTP 回归测试,覆盖 JSON 变长、变短、SSE 和 429 错误透传。

验证

  • go test -race ./internal/ingress -run '^TestRelayKitResponseFramingAfterConversion$' -count=1:4 个场景通过;修复前三个转换场景失败。
  • go vet ./...:通过。
  • gofmt -l、git diff --check:通过。

实现由 AI 辅助完成。

Discard upstream Content-Length for successful conversions and cover larger and smaller JSON bodies, SSE output, and error passthrough over real HTTP connections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 协议转换保留上游 Content-Length,导致响应读取失败

1 participant