Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Cookiejar implementation. #526
base: master
Are you sure you want to change the base?
Cookiejar implementation. #526
Changes from 16 commits
4d4dd56
d1c2da3
afe131d
19b0b82
dfa5cd6
bd93cab
918f83a
62aeb5c
22084f4
28227ec
be7e6ae
6224a86
3602a4f
6a6af76
a9f4a40
0cd5fc1
9fad3e0
31e20ed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Better do the expired check here first so you don't acquire and release a cookie immediately if it didn't exist already.
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 don't see any other way to do this.
If I do the expiration checking at cookiejar.go:197 first I need to call ParseBytes and the code will be repeated in the case
c == nil
andc != nil
. I prefer to keep it like this unless you see any other way to do 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.
Yes you are right, I forgot that you have to somehow parse the cookie first to get the expiration date. Doing that in a stack allocate cookie value would be possible for example but it would result in messier code.