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.

Author:
Mike Bowler, Noboru Sinohara, David D. Kilzer, Marc Guillemot, Brad Clarke, Ahmed Ashour, Nicolas Belisle, Ronald Brill, John J Murdoch
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    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
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.apache.http.Header>
    formatCookies(List<org.apache.http.cookie.Cookie> cookies)
     
    int
     
    org.apache.http.Header
     
    List<org.apache.http.cookie.Cookie>
    parse(org.apache.http.Header header, org.apache.http.cookie.CookieOrigin origin)
     

    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

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • LOCAL_FILESYSTEM_DOMAIN

      public static final String LOCAL_FILESYSTEM_DOMAIN
      Workaround for domain of local files.
      See Also:
  • Constructor Details

    • HtmlUnitBrowserCompatCookieSpec

      public HtmlUnitBrowserCompatCookieSpec(BrowserVersion browserVersion)
      Constructor.
      Parameters:
      browserVersion - the BrowserVersion 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

      public List<org.apache.http.Header> formatCookies(List<org.apache.http.cookie.Cookie> cookies)
    • getVersion

      public int getVersion()
    • getVersionHeader

      public org.apache.http.Header getVersionHeader()
    • toString

      public String toString()
      Overrides:
      toString in class Object