tauri-apps / tauri-apps/plugins-workspace

Clarification Needed on cookies Feature Filtering Headers in tauri-plugin-http

Open
#2,016 0 comments 0 reactions 0 assignees View on GitHub
plugin: http
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

**Description**:
I encountered an unexpected behavior with `tauri-plugin-http` version 2 related to handling "unsafe" headers, such as `Set-Cookie`, and third-party cookie management. Initially, I added `features = ["unsafe-headers", "cookies"]`, expecting the `cookies` feature to allow full cookie handling. However, it filtered these headers instead.

**Resolution**:
The issue was resolved by declaring the dependency as follows:

```toml
tauri-plugin-http = { version = "2", features = ["unsafe-headers", "rustls-tls", "http2", "charset", "macos-system-configuration"], default-features = false }
```

By specifying only the necessary features without `cookies` and setting `default-features = false`, the filtering of headers like `Set-Cookie` was removed.

**Expected Behavior**:
Including the `cookies` feature was expected to handle all cookies, including third-party cookies, without filtering "unsafe" headers.

**Observed Behavior**:
With the `cookies` feature enabled, certain "unsafe" headers, especially those like `Set-Cookie` related to third-party cookies, were filtered.

**Suggested Solution**:
- Update documentation to clarify that the `cookies` feature impacts the handling of certain headers, including `Set-Cookie`, by filtering them.
- Consider renaming or updating the behavior to make it clearer for users expecting full cookie and third-party cookie handling without header filtering.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.