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

feat(client): remove set_cookies_by_ref #474

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions src/client/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1695,31 +1695,6 @@ impl ClientRef {
}
}

/// Injects a 'Cookie' into the 'CookieStore' for the specified URL, using references to `HeaderValue`.
///
/// This method accepts a collection of cookies by reference, which can be either a slice (`&[&'a HeaderValue]`).
/// It will map each reference to the value of `HeaderValue` and pass the resulting iterator to the `cookie_store`
/// for processing.
///
/// # Parameters
/// - `url`: The URL associated with the cookies to be set.
/// - `cookies`: A collection of references to `HeaderValue` items.
///
/// This method ensures that cookies are only set if at least one cookie
/// exists in the collection.
#[cfg(feature = "cookies")]
pub fn set_cookies_by_ref<'a, C>(&self, url: &Url, cookies: C)
where
C: AsRef<[&'a HeaderValue]>,
{
if let Some(ref cookie_store) = self.inner.cookie_store {
let mut cookies = cookies.as_ref().iter().copied().peekable();
if cookies.peek().is_some() {
cookie_store.set_cookies(&mut cookies, url);
}
}
}

/// Clears all cookies from the `CookieStore`.
///
/// This method removes all cookies stored in the client's `CookieStore`.
Expand Down
Loading