Package org.htmlunit.httpclient
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 Date
private static final HtmlUnitBrowserCompatCookieSpec.NetscapeDraftHeaderParser
static final String
The cookie name used for cookies with no name (HttpClient doesn't like empty names).static final String
Workaround 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) int
org.apache.http.Header
private static boolean
List
<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, validate
Methods 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
Workaround for domain of local files.- See Also:
-
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
- theBrowserVersion
to 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
-