Example usage for org.apache.http.cookie CookieOrigin isSecure

List of usage examples for org.apache.http.cookie CookieOrigin isSecure

Introduction

In this page you can find the example usage for org.apache.http.cookie CookieOrigin isSecure.

Prototype

public boolean isSecure() 

Source Link

Usage

From source file:com.gargoylesoftware.htmlunit.httpclient.HtmlUnitPathHandler.java

@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
    CookieOrigin newOrigin = origin;//from   w ww  .ja  v  a 2 s  .  c o m
    String targetpath = origin.getPath();
    if (browserVersion_.hasFeature(HTTP_COOKIE_EXTRACT_PATH_FROM_LOCATION) && !targetpath.isEmpty()) {
        final int lastSlashPos = targetpath.lastIndexOf('/');
        if (lastSlashPos > 1 && lastSlashPos < targetpath.length()) {
            targetpath = targetpath.substring(0, lastSlashPos);
            newOrigin = new CookieOrigin(origin.getHost(), origin.getPort(), targetpath, origin.isSecure());
        }
    }

    return super.match(cookie, newOrigin);
}