Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature/enable cookie store at request level#1567

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
tranchitam wants to merge4 commits intoAsyncHttpClient:main
base:main
Choose a base branch
Loading
fromtranchitam:feature/enable-cookie-store-at-request-level

Conversation

@tranchitam
Copy link

@tranchitamtranchitam commentedJul 31, 2018
edited
Loading

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:

  • Request hasgetCookieStore() method.
  • RequestBuilder hassetCookieStore() method to set cookie store -> cookie store at request level isnull by 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

RussiaVk reacted with thumbs up emoji
Realmrealm =request.getRealm() !=null ?request.getRealm() :config.getRealm();

// This MUST BE called before Redirect30xInterceptor because latter assumes cookie store is already updated
CookieStorecookieStore =config.getCookieStore();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

CookieStore cookieStore = request.getCookieStore() != null ? request.getCookieStore() : config.getCookieStore() ;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I already updated.

CookieStorecookieStore =config.getCookieStore();
if (cookieStore !=null) {
CookieStorerequestCookieStore =request.getCookieStore();
if (cookieStore !=null ||requestCookieStore !=null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please restore

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Restored


if (requestCookieStore !=null) {
requestCookieStore.add(request.getUri(),c);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please restore

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Restored

@slandelle
Copy link
Contributor

slandelle commentedAug 27, 2018
edited
Loading

@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.

RussiaVk reacted with thumbs up emoji

@slandelleslandelleforce-pushed themaster branch 5 times, most recently from6ea11f4 tof8fab66CompareFebruary 7, 2020 12:25
@tranchitam
Copy link
Author

Hi@slandelle, I already updated the pull request to fix your comments. Please take a look. Thanks

@mkurz
Copy link

@slandelle Can you have a look?

@mkurz
Copy link

Also there is#1610 now, however seems liks it's just re-using the commits from this pull request here.

@leomaiwego
Copy link

@slandelle Could you please take a look to this one?

@tranchitam
Copy link
Author

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.

mkurz reacted with thumbs up emojiRussiaVk reacted with laugh emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@slandelleslandelleslandelle requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@tranchitam@slandelle@mkurz@leomaiwego

[8]ページ先頭

©2009-2025 Movatter.jp