egress: package doc says 3xx is returned as a normal response; Conduit refuses redirects with ErrForbidden

未关闭 适合新手
#167 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
72/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
documentation

调研方向

从这个 SDK 中的 egress/doc.go 开始,阅读 issue 中引用的 "Redirects are not followed" 一节,然后将其与 ConduitIO/conduit pkg/plugin/processor/egress/service.go 中宿主的行为进行比较(CheckRedirect 返回 errRedirectBlocked,而 classifyDoError 将其映射为 ErrHTTPForbidden)。判断维护者想要两种修复中的哪一种——低成本的做法是重写文档,把 3xx 记录为以 ErrForbidden 失败且没有 Response;另一种方案需要在 conduit 仓库中编写 design doc 以返回 http.ErrUseLastResponse。当包文档不再承诺 processors 永远无法收到的 3xx Response,且改动与 ConduitIO/conduit-site#363 中引用的站点文档一致时即算完成。

由索引模型根据 Issue 内容生成。

描述

bug

The egress package doc in v0.6.0 (egress/doc.go, "Redirects are not followed") says:

A 3xx response is returned to the caller as an ordinary [Response], never followed automatically.

Conduit's host doesn't behave that way. Its client's CheckRedirect returns errRedirectBlocked (ConduitIO/conduit pkg/plugin/processor/egress/service.go:103-105, :200-202). http.Client.Do then returns an error rather than the 3xx response, and classifyDoError maps it to ErrHTTPForbidden ("redirects are not followed", service.go:452-454). A processor calling egress.Do against a redirecting endpoint gets egress.ErrForbidden and no Response.

Both behaviors keep the allowlist closed. But a processor written against the doc will look for resp.StatusCode 3xx and never get one.

Fix, either:

  • update the doc: a 3xx fails with ErrForbidden and no response is delivered, or
  • if the documented behavior is intended, change the host to return http.ErrUseLastResponse so the 3xx comes back as a response (a conduit change, design doc first since it touches the egress boundary).

The site docs (ConduitIO/conduit-site#363) describe the current host behavior.

🤖 Generated with Claude Code

主要语言
Go
星标
1
派生
1
平均合并
11 分钟
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ConduitIO/conduit-processor-sdk 的其他 Issue

查看 ConduitIO/conduit-processor-sdk 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。