-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature/enable cookie store at request level #1567
base: main
Are you sure you want to change the base?
Changes from 2 commits
105f388
ed0895b
f2a96bd
dc2e23c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,12 +71,19 @@ public boolean exitAfterIntercept(Channel channel, | |
|
||
// This MUST BE called before Redirect30xInterceptor because latter assumes cookie store is already updated | ||
CookieStore cookieStore = config.getCookieStore(); | ||
if (cookieStore != null) { | ||
CookieStore requestCookieStore = request.getCookieStore(); | ||
if (cookieStore != null || requestCookieStore != null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please restore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restored |
||
for (String cookieStr : responseHeaders.getAll(SET_COOKIE)) { | ||
Cookie c = cookieDecoder.decode(cookieStr); | ||
if (c != null) { | ||
// Set-Cookie header could be invalid/malformed | ||
cookieStore.add(future.getCurrentRequest().getUri(), c); | ||
if (cookieStore != null) { | ||
cookieStore.add(future.getCurrentRequest().getUri(), c); | ||
} | ||
|
||
if (requestCookieStore != null) { | ||
requestCookieStore.add(request.getUri(), c); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please restore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restored |
||
} | ||
} | ||
} | ||
|
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.
CookieStore cookieStore = request.getCookieStore() != null ? request.getCookieStore() : config.getCookieStore() ;
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 already updated.