RFC2965DomainAttributeHandlerHC4.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:remote-files-sync 作者:
/**
 * Match cookie domain attribute.
 */
public boolean match(final Cookie cookie, final CookieOrigin origin) {
    Args.notNull(cookie, "Cookie");
    Args.notNull(origin, "Cookie origin");
    final String host = origin.getHost().toLowerCase(Locale.ENGLISH);
    final String cookieDomain = cookie.getDomain();

    // The effective host name MUST domain-match the Domain
    // attribute of the cookie.
    if (!domainMatch(host, cookieDomain)) {
        return false;
    }
    // effective host name minus domain must not contain any dots
    final String effectiveHostWithoutDomain = host.substring(
            0, host.length() - cookieDomain.length());
    return effectiveHostWithoutDomain.indexOf('.') == -1;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号