-
Notifications
You must be signed in to change notification settings - Fork 322
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
Cookie Improvement #170
Cookie Improvement #170
Conversation
/ping @aturon @yoshuawuyts @bIgBV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love how simple adding extensions is. This is a great change.
I've left some comments which are mostly around error handling.
I think I should change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Ready for merge. Build fail because of futures api change. |
LGTM. The only thing I'd say (and this is just commentary) is that we may want to come up with a better term for these extension traits. If Then again, we can rename them both so long as it happens before a release, now that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic PR! Just left a couple of minor nits.
let arc_jar = cookie_data.content.clone(); | ||
let locked_jar = arc_jar | ||
.read() | ||
.map_err(|e| StringError(format!("Failed to get write lock: {}", e)))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be "read lock"
|
||
cookie | ||
let arc_jar = cookie_data.content.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this clone required?
.extensions() | ||
.get::<CookieData>() | ||
.ok_or_else(|| StringError(MIDDLEWARE_MISSING_MSG.to_owned()))?; | ||
let jar = cookie_data.content.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this clone required?
.get::<CookieData>() | ||
.ok_or_else(|| StringError(MIDDLEWARE_MISSING_MSG.to_owned()))?; | ||
|
||
let jar = cookie_data.content.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this clone required?
@secretfader Agreed re: needing a solid convention here. I've opened an issue. |
I'm gonna go ahead and merge and will fix the nits in follow-up. Thanks so much @mmrath, this is great work! |
Description
This change adds support for adding, removing cookies on top of currently supported retrieval.
Breaking changes:
ExtractCookies
is renamed toCookiesExt
because this is no longer just extraction featureMotivation and Context
Every web application needs to deal with cookies at some stage. Hopefully this approach is simple and ergonomic
How Has This Been Tested?
Test cases written for simple cases. Examples included for basic features.
Types of changes
Checklist: