-
Notifications
You must be signed in to change notification settings - Fork 90
Fixed #1617 - The specified SyncGatewaySession value with /_replicate REST API is not used. #1618
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
Conversation
…ieJar, all cookies should be stored into the CookieJar.
| // NOTE: In case that the path of URL is not end with `/`, | ||
| // last segment of a path is not stored as a path of Cookie. | ||
| Cookie cookie = Cookie.parse(HttpUrl.get(remote), cookieString); | ||
| if (cookie != null && replicationInternal != null) { |
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 think we don't need to check if the replicationInternal is null here as it will not be null?
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.
Does it also need to remove the Cookies from the requestHeadersParams as well? I don't know the behavior when the cookies are in both headers and cookie jar.
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.
for comment 1
- replicationInternal should not be null. So I will remove this.
for comment 2
- Cookie's in Cookie jar always overwrite if it exists. However, passed cookie value in the headers does not includes expirers, domain, and path. So it could send two cookies in the final request header. As you advise, I feel it is better to remove from headers Map object.
|
@pasin applied feedback from you. Please review this PR again? |
|
|
||
| private void storeCookiesIntoCookieJar(Map<String, Object> requestHeadersParam) { | ||
| try { | ||
| if (requestHeadersParam.containsKey("Cookie") && requestHeadersParam.get("Cookie") instanceof String) { |
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 think requestHeadersParam can be null so null check would be required.
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.
thanks!
|
@pasin can you re-review? |
Please refer https://github.com/couchbase/couchbase-lite-java-core/issues/1617#issue-220851080 for details.