修正Cookie在子域名无效的问题

@org.apache.http.impl.cookie.BasicDomainHandler.match()
pull/828/head
suym845 7 years ago
parent be892b80bf
commit 0b3fa6cf1e

@ -138,12 +138,14 @@ public class HttpClientGenerator {
for (Map.Entry<String, String> cookieEntry : site.getCookies().entrySet()) {
BasicClientCookie cookie = new BasicClientCookie(cookieEntry.getKey(), cookieEntry.getValue());
cookie.setDomain(site.getDomain());
cookie.setAttribute(BasicClientCookie.DOMAIN_ATTR, site.getDomain());
cookieStore.addCookie(cookie);
}
for (Map.Entry<String, Map<String, String>> domainEntry : site.getAllCookies().entrySet()) {
for (Map.Entry<String, String> cookieEntry : domainEntry.getValue().entrySet()) {
BasicClientCookie cookie = new BasicClientCookie(cookieEntry.getKey(), cookieEntry.getValue());
cookie.setDomain(domainEntry.getKey());
cookie.setAttribute(BasicClientCookie.DOMAIN_ATTR, domainEntry.getKey());
cookieStore.addCookie(cookie);
}
}

Loading…
Cancel
Save