Skip to content

Conversation

@hideki
Copy link

@hideki hideki commented Apr 13, 2017

// 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) {
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Author

@hideki hideki Apr 13, 2017

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.

@hideki
Copy link
Author

hideki commented Apr 13, 2017

@pasin applied feedback from you. Please review this PR again?

hideki pushed a commit to couchbase/couchbase-lite-android that referenced this pull request Apr 13, 2017

private void storeCookiesIntoCookieJar(Map<String, Object> requestHeadersParam) {
try {
if (requestHeadersParam.containsKey("Cookie") && requestHeadersParam.get("Cookie") instanceof String) {
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

thanks!

@hideki
Copy link
Author

hideki commented Apr 14, 2017

@pasin can you re-review?

@pasin pasin merged commit 1ee944a into master Apr 14, 2017
@pasin pasin deleted the hotfix/1.4.0.CBL-36 branch April 14, 2017 17:14
@pasin pasin removed the in progress label Apr 14, 2017
@djpongh djpongh added this to the 1.3.2 milestone Apr 24, 2017
hideki pushed a commit to couchbase/couchbase-lite-android that referenced this pull request Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants