async-http-client
async-http-client copied to clipboard
Feature/enable cookie store at request level
Motivations:
- Enable the ability to pass CookieStore at request level -> cookies between different requests having the same URI will be independent and will not override each other.
- Still keep global CookieStore from config.
Changes:
RequesthasgetCookieStore()method.RequestBuilderhassetCookieStore()method to set cookie store -> cookie store at request level isnullby default.- When http responses come -> add cookies to request cookie store if it's present, otherwise add cookies to global cookie store.
- When setting cookies for redirect request -> if request cookie store is present, get cookies from request cookie store and set them to redirect request. Otherwise, if global cookie store is present, get cookies from global cookie store and and them to redirect request.
Results:
- Still keep global cookie store.
- If request has its own cookie store -> cookies for different requests having the same URI will be independent and not override each other
Related issue:
#1565
@tranchitam Did you get a chance to have a look at my comments. The idea is to be able to override the global CookieStore with one scoped at request level. Those 2 are exclusive and only one should be updated.
Hi @slandelle, I already updated the pull request to fix your comments. Please take a look. Thanks
@slandelle Can you have a look?
Also there is #1610 now, however seems liks it's just re-using the commits from this pull request here.
@slandelle Could you please take a look to this one?
Hi @slandelle, @TomGranot have you got time to take a look into this pull request again? If there is no issue, we really want to merge this PR to master as soon as possible.