On 27/10/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Author: olegk
> Date: Mon Oct 27 09:08:27 2008
> New Revision: 708225
>
> URL: http://svn.apache.org/viewvc?rev=708225&view=rev
> Log:
> Fixed broken #parse(HeaderElement[], CookieOrigin) method in the RFC2965Spec
> cookie spec
>
<snip/>
==============================================================================
> ---
> httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieBestMatchSpec.java
> (original)
> +++
> httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieBestMatchSpec.java
> Mon Oct 27 09:08:27 2008
> @@ -43,6 +43,7 @@
> import org.apache.http.cookie.CookieOrigin;
> import org.apache.http.cookie.CookieSpec;
> import org.apache.http.cookie.MalformedCookieException;
> +import org.apache.http.cookie.SetCookie2;
> import org.apache.http.message.BasicHeader;
>
> /**
> @@ -123,6 +124,36 @@
> }
> }
>
> + public void testCookieStandardCompliantParsingLocalHost() throws
> Exception {
> + CookieSpec cookiespec = new BestMatchSpec();
> + CookieOrigin origin = new CookieOrigin("localhost", 80, "/", false);
> +
> + Header header = new BasicHeader("Set-Cookie", "special=\"abcdigh\";
> Version=1");
> +
> + List<Cookie> cookies = cookiespec.parse(header, origin);
> + for (int i = 0; i < cookies.size(); i++) {
> + Cookie cookie = cookies.get(i);
> + cookiespec.validate(cookie, origin);
> + assertEquals("localhost.local", cookie.getDomain());
> + assertTrue(cookie instanceof SetCookie2);
This does not look right - the header is using Set-Cookie, not Set-Cookie2
S///
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]