mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-27 21:29:12 +00:00
Corrected handling of cookie attributes with null value
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1644165 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dd354a8ba5
commit
4e4424a584
@ -315,7 +315,14 @@ public String getAttribute(final String name) {
|
||||
|
||||
@Override
|
||||
public boolean containsAttribute(final String name) {
|
||||
return this.attribs.get(name) != null;
|
||||
return this.attribs.containsKey(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 4.4
|
||||
*/
|
||||
public boolean removeAttribute(final String name) {
|
||||
return this.attribs.remove(name) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -399,8 +399,8 @@ public void testCookieNullDomainNullPathFormatting() {
|
||||
Assert.assertEquals(1, headers.size());
|
||||
Assert.assertEquals("$Version=0; name=; $Path=/", headers.get(0).getValue());
|
||||
|
||||
cookie.setAttribute(ClientCookie.DOMAIN_ATTR, null);
|
||||
cookie.setAttribute(ClientCookie.PATH_ATTR, null);
|
||||
cookie.removeAttribute(ClientCookie.DOMAIN_ATTR);
|
||||
cookie.removeAttribute(ClientCookie.PATH_ATTR);
|
||||
cookies = new ArrayList<Cookie>();
|
||||
cookies.add(cookie);
|
||||
headers = cookiespec.formatCookies(cookies);
|
||||
|
Loading…
x
Reference in New Issue
Block a user