Class HtmlUnitBrowserCompatCookieSpec
java.lang.Object
org.apache.http.impl.cookie.AbstractCookieSpec
org.apache.http.impl.cookie.CookieSpecBase
org.htmlunit.httpclient.HtmlUnitBrowserCompatCookieSpec
- All Implemented Interfaces:
org.apache.http.cookie.CookieSpec
public class HtmlUnitBrowserCompatCookieSpec
extends org.apache.http.impl.cookie.CookieSpecBase
Customized BrowserCompatSpec for HtmlUnit.
Workaround for HttpClient bug 1006: quotes are wrongly removed in cookie's values. Implementation is based on the HttpClient code.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Comparator<org.apache.http.cookie.Cookie> Comparator for sending cookies in right order.(package private) static final Dateprivate static final HtmlUnitBrowserCompatCookieSpec.NetscapeDraftHeaderParserstatic final StringThe cookie name used for cookies with no name (HttpClient doesn't like empty names).static final StringWorkaround for domain of local files. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.http.Header> formatCookies(List<org.apache.http.cookie.Cookie> cookies) intorg.apache.http.Headerprivate static booleanList<org.apache.http.cookie.Cookie> parse(org.apache.http.Header header, org.apache.http.cookie.CookieOrigin origin) toString()Methods inherited from class org.apache.http.impl.cookie.CookieSpecBase
getDefaultDomain, getDefaultPath, match, parse, validateMethods inherited from class org.apache.http.impl.cookie.AbstractCookieSpec
findAttribHandler, getAttribHandler, getAttribHandlers, registerAttribHandler
-
Field Details
-
EMPTY_COOKIE_NAME
The cookie name used for cookies with no name (HttpClient doesn't like empty names).- See Also:
-
LOCAL_FILESYSTEM_DOMAIN
-
COOKIE_COMPARATOR
Comparator for sending cookies in right order. See specification: - RFC2109 (#4.3.4) http://www.ietf.org/rfc/rfc2109.txt - RFC2965 (#3.3.4) http://www.ietf.org/rfc/rfc2965.txt http://www.ietf.org/rfc/rfc2109.txt -
DEFAULT_NETSCAPE_DRAFT_HEADER_PARSER
private static final HtmlUnitBrowserCompatCookieSpec.NetscapeDraftHeaderParser DEFAULT_NETSCAPE_DRAFT_HEADER_PARSER -
DATE_1_1_1970
-
-
Constructor Details
-
HtmlUnitBrowserCompatCookieSpec
Constructor.- Parameters:
browserVersion- theBrowserVersionto simulate
-
-
Method Details
-
parse
public List<org.apache.http.cookie.Cookie> parse(org.apache.http.Header header, org.apache.http.cookie.CookieOrigin origin) throws org.apache.http.cookie.MalformedCookieException - Throws:
org.apache.http.cookie.MalformedCookieException
-
formatCookies
-
isQuoteEnclosed
-
getVersion
public int getVersion() -
getVersionHeader
public org.apache.http.Header getVersionHeader() -
toString
-