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

Đang mở
#8,116 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
ios, swift
Lĩnh vực
mobile-dev, networking

Hướng nghiên cứu

Bắt đầu với bản tái hiện được liên kết capacitor-http-troubleshoot và so sánh hành vi của CapacitorHttp đối với yêu cầu POST trên iOS, Android và web. Điều tra cách CapacitorHttp xử lý chuyển hướng trên iOS; công việc được xem là hoàn tất khi header Authorization được giữ lại trong yêu cầu sau một chuyển hướng 302 mà không gây hồi quy trên các nền tảng khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
17.1k
Fork
1.3k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ionic-team/capacitor

Tất cả issue của ionic-team/capacitor

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.