CookieStore cleanup/fixes

* Remove TODO
* Remove Cookie::set_ setters
* Do not expose SameSite enum, provide getters on Cookie instead
* Simplify Response::cookies signature (now ignores errors)
This commit is contained in:
Christoph Herzog
2019-03-26 13:00:07 +01:00
committed by Sean McArthur
parent 954fdfae30
commit 9935a8e117
5 changed files with 17 additions and 98 deletions

View File

@@ -124,10 +124,11 @@ impl Response {
}
/// Retrieve the cookies contained in the response.
pub fn cookies<'a>(&'a self) -> impl Iterator<
Item = Result<cookie::Cookie<'a>, cookie::CookieParseError>
> + 'a {
///
/// Note that invalid 'Set-Cookie' headers will be ignored.
pub fn cookies<'a>(&'a self) -> impl Iterator< Item = cookie::Cookie<'a> > + 'a {
cookie::extract_response_cookies(self.headers())
.filter_map(Result::ok)
}