Java Code Examples for org.apache.http.cookie.CookieOrigin#getPort()
The following examples show how to use
org.apache.http.cookie.CookieOrigin#getPort() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SolrPortAwareCookieSpecFactory.java From lucene-solr with Apache License 2.0 | 5 votes |
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (origin != null && origin.getHost() != null && cookie != null) { String hostPort = origin.getHost() + ":" + origin.getPort(); String domain = cookie.getDomain(); if (hostPort.equals(domain)) { return; } } super.validate(cookie, origin); }
Example 2
Source File: SolrPortAwareCookieSpecFactory.java From lucene-solr with Apache License 2.0 | 5 votes |
@Override public boolean match(final Cookie cookie, final CookieOrigin origin) { if (origin != null && origin.getHost() != null && cookie != null) { String hostPort = origin.getHost() + ":" + origin.getPort(); String domain = cookie.getDomain(); if (hostPort.equals(domain)) { return true; } } return super.match(cookie, origin); }