Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

AhcClientHandler.handleCookie() method #9

Open
agherardi opened this issue Oct 14, 2015 · 0 comments
Open

AhcClientHandler.handleCookie() method #9

agherardi opened this issue Oct 14, 2015 · 0 comments

Comments

@agherardi
Copy link

Hi,
Method AhcClientHandler.handleCookie() does the following:

private void handleCookie(final RequestBuilder requestBuilder) {
    for (final Cookie c : cookies) {
        requestBuilder.addCookie(c);
    }
}

This ends up calling RequestBuilderBase.addCookie():

public T addCookie(Cookie cookie) {
    lazyInitCookies();
    request.cookies.add(cookie);
    return derived.cast(this);
}

Won't this cause all cookies to be attached to the request, regardless of domain/path/expiration, etc.?

If I run this code:

client.resource("http://www.amazon.com").get(ClientResponse.class);
client.resource("http://10.220.178.235").get(ClientResponse.class);

looking at the wireshark capture, I see the Amazon cookies being sent to 10.220.178.235.

Thoughts?

Thank you in advance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@agherardi and others