[Bug]: CapacitorHttp: Authorization header not forwarded on 302 redirect (iOS only)

未关闭
#8,116 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
ios, swift

调研方向

从链接的 capacitor-http-troubleshoot 复现开始,比较 CapacitorHttp 在 iOS、Android 和 web 上处理 POST 请求时的行为。调查 CapacitorHttp 在 iOS 上的重定向处理;完成标准是 302 重定向后的请求仍保留 Authorization 标头,同时不导致其他平台出现回归问题。

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

描述

triage
Capacitor Version

Latest Dependencies:

@capacitor/cli: 7.4.3
@capacitor/core: 7.4.3
@capacitor/android: 7.4.3
@capacitor/ios: 7.4.3

Installed Dependencies:

@capacitor/cli: 7.4.3
@capacitor/ios: 7.4.3
@capacitor/core: 7.4.3
@capacitor/android: 7.4.3

Other API Details
npm --version output: 11.4.2
node --version output: v24.3.0
pod --version output: 1.16.2
Platforms Affected
  • iOS
  • Android
  • Web
Current Behavior

When using the CapacitorHttp plugin, Authorization header is not included in the redirected request on iOS. On Android, and when running as a web app on iOS/mac, the header is forwarded as expected. It also works when CapacitorHttp is disabled. This issue appears to affect only POST requests with 302 redirects.

Expected Behavior

Authorization header from the POST request should be included in the redirect request.

Project Reproduction

https://github.com/ruifang/capacitor-http-troubleshoot

Additional Information

Http request used in example:

POST /redirect-to?url=headers HTTP/1.1
Host: httpbingo.org
Authorization: Bearer 1234
X-Custom-Header: 123456

iOS:
https://github.com/user-attachments/assets/bf413401-c37b-4005-88d9-dae325103725
Safari:
https://github.com/user-attachments/assets/7b0e57c7-7811-4886-958d-d5314271ea23
Android:
https://github.com/user-attachments/assets/653e63f7-34a8-44fa-b0ba-47a2c3fb224e

主要语言
TypeScript
星标
17.1k
派生
1.3k
平均合并
1 天 22 小时
30 天内合并 PR
26

环境准备

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

从这里开始

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

ionic-team/capacitor 的其他 Issue

查看 ionic-team/capacitor 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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