mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-28 05:39:07 +00:00
Moved attributes used only by strict specs when formatting cookies to SetCookie interface
git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@563548 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6475dd23d8
commit
b88791b45f
@ -123,23 +123,5 @@ public interface Cookie {
|
||||
*/
|
||||
boolean isExpired(final Date date);
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if cookie's path was set via a path attribute
|
||||
* in the <tt>Set-Cookie</tt> header.
|
||||
*
|
||||
* @return value <tt>true</tt> if the cookie's path was explicitly
|
||||
* set, <tt>false</tt> otherwise.
|
||||
*/
|
||||
boolean isPathAttributeSpecified();
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if cookie's domain was set via a domain
|
||||
* attribute in the <tt>Set-Cookie</tt> header.
|
||||
*
|
||||
* @return value <tt>true</tt> if the cookie's domain was explicitly
|
||||
* set, <tt>false</tt> otherwise.
|
||||
*/
|
||||
boolean isDomainAttributeSpecified();
|
||||
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,15 @@ public interface SetCookie extends Cookie {
|
||||
*/
|
||||
void setVersion(int version);
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if cookie's path was set via a path attribute
|
||||
* in the <tt>Set-Cookie</tt> header.
|
||||
*
|
||||
* @return value <tt>true</tt> if the cookie's path was explicitly
|
||||
* set, <tt>false</tt> otherwise.
|
||||
*/
|
||||
boolean isPathAttributeSpecified();
|
||||
|
||||
/**
|
||||
* Indicates whether the cookie had a path specified in a
|
||||
* path attribute of the <tt>Set-Cookie</tt> header. This value
|
||||
@ -124,6 +133,15 @@ public interface SetCookie extends Cookie {
|
||||
*/
|
||||
public void setPathAttributeSpecified(boolean value);
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if cookie's domain was set via a domain
|
||||
* attribute in the <tt>Set-Cookie</tt> header.
|
||||
*
|
||||
* @return value <tt>true</tt> if the cookie's domain was explicitly
|
||||
* set, <tt>false</tt> otherwise.
|
||||
*/
|
||||
boolean isDomainAttributeSpecified();
|
||||
|
||||
/**
|
||||
* Indicates whether the cookie had a domain specified in a
|
||||
* domain attribute of the <tt>Set-Cookie</tt> header. This value
|
||||
|
@ -30,15 +30,9 @@
|
||||
|
||||
package org.apache.http.impl.conn.tsccm;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.http.conn.HttpRoute;
|
||||
//@@@ create entry w/o operator, set operator afterwards
|
||||
import org.apache.http.conn.ClientConnectionOperator; //@@@
|
||||
|
||||
|
||||
/**
|
||||
* A connection sub-pool for a specific route, used by {@link ConnPoolByRoute}.
|
||||
|
@ -41,7 +41,6 @@
|
||||
import org.apache.http.conn.ManagedClientConnection;
|
||||
import org.apache.http.conn.OperatedClientConnection;
|
||||
import org.apache.http.conn.SchemeRegistry;
|
||||
import org.apache.http.conn.params.HttpConnectionManagerParams;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.apache.http.impl.conn.DefaultClientConnectionOperator;
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
import org.apache.http.cookie.CookiePathComparator;
|
||||
import org.apache.http.cookie.MalformedCookieException;
|
||||
import org.apache.http.cookie.SM;
|
||||
import org.apache.http.cookie.SetCookie;
|
||||
import org.apache.http.message.BufferedHeader;
|
||||
import org.apache.http.util.CharArrayBuffer;
|
||||
|
||||
@ -208,13 +209,17 @@ private void formatParamAsVer(final CharArrayBuffer buffer,
|
||||
private void formatCookieAsVer(final CharArrayBuffer buffer,
|
||||
final Cookie cookie, int version) {
|
||||
formatParamAsVer(buffer, cookie.getName(), cookie.getValue(), version);
|
||||
if (cookie.getPath() != null && cookie.isPathAttributeSpecified()) {
|
||||
buffer.append("; ");
|
||||
formatParamAsVer(buffer, "$Path", cookie.getPath(), version);
|
||||
if (cookie.getPath() != null) {
|
||||
if (cookie instanceof SetCookie && ((SetCookie) cookie).isPathAttributeSpecified()) {
|
||||
buffer.append("; ");
|
||||
formatParamAsVer(buffer, "$Path", cookie.getPath(), version);
|
||||
}
|
||||
}
|
||||
if (cookie.getDomain() != null && cookie.isDomainAttributeSpecified()) {
|
||||
buffer.append("; ");
|
||||
formatParamAsVer(buffer, "$Domain", cookie.getDomain(), version);
|
||||
if (cookie.getDomain() != null) {
|
||||
if (cookie instanceof SetCookie && ((SetCookie) cookie).isDomainAttributeSpecified()) {
|
||||
buffer.append("; ");
|
||||
formatParamAsVer(buffer, "$Domain", cookie.getDomain(), version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user