-
Notifications
You must be signed in to change notification settings - Fork 45
curl import: -b / --cookie flag not recognized, cookies silently dropped #66
Copy link
Copy link
Open
Description
Description
When importing a curl command that uses -b (or --cookie) to pass cookies, the parser silently drops both the flag and the cookie value. No error
or warning is shown.
Steps to Reproduce
- Copy a curl command with
-bflag, e.g.:
curl 'https://example.com/api/data'
-b 'session=abc123; token=xyz'
-H 'accept: application/json' - Import it via the curl import dialog
- Observe that cookies are missing from the imported request
Root Cause
In apps/desktop/src-tauri/src/http/curl.rs, the parse_curl() match block does not handle -b / --cookie. The flag hits the default _ branch
and is skipped. The following token (cookie value) is also silently consumed or ignored.
Expected Behavior
Cookies from -b / --cookie should be parsed and imported — either as a Cookie header or into the cookie management system (#29, #40).
Suggested Fix
Add a match arm in parse_curl():
"-b" | "--cookie" => {
if let Some(cookie_val) = iter.next() {
headers.insert("Cookie".to_string(), cookie_val.clone());
}
}
Related
- #39 (curl import)
- #40 (cookie management)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels