Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Cookie header stripped from capacitor http request #7013

Open
aeharding opened this issue Oct 23, 2023 · 3 comments
Open

bug: Cookie header stripped from capacitor http request #7013

aeharding opened this issue Oct 23, 2023 · 3 comments

Comments

@aeharding
Copy link

aeharding commented Oct 23, 2023

Bug Report

Capacitor Version

Affected versions: 5.4.0-5.5.0

Platform(s)

  • Android
  • iOS

Current Behavior

When making a request through Capacitor, I cannot set a custom Cookie header. It is stripped from the request.

Expected Behavior

In Capacitor 5.3.0 and below, the cookie was not stripped from the request.

Code Reproduction

Enable CapacitorHttp in capacitor.config.json.

Add to index.html

fetch("https://example.com/movies.json", { headers: { Cookie: "foo=bar" } });

Inspect logs running natively

Other Technical Details

npm --version output:
10.1.0
node --version output:
v20.8.1
pod --version output (iOS issues only):

Additional Context

@aeharding
Copy link
Author

Better reproduction:

Not working against latest capacitor (v5.5.0) reproduction

https://github.com/aeharding/test-fetch/tree/main

image

Working against old capacitor (v5.2.3) reproduction

https://github.com/aeharding/test-fetch/tree/working-old-capacitor

image

@kpturner
Copy link

kpturner commented May 1, 2024

So no response to this problem since Nov 2023?

@MirazMac
Copy link

Any update regarding this? At least allow us to filter or intercept the request before sending so we may insert these headers via a hook or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants