jdk/test/java/net/CookieHandler/B6644726.java
author jccollet
Thu, 04 Sep 2008 15:26:53 +0200
changeset 1234 e3dc213d4879
parent 480 c309ca1d3a86
child 4154 afd948aaf965
permissions -rw-r--r--
6692802: HttpCookie needs to support HttpOnly attribute Summary: Added HttpOnly tag support to HttpCookie class. Reviewed-by: chegar, michaelm
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
480
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     1
/*
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     2
 * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     4
 *
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     7
 * published by the Free Software Foundation.
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     8
 *
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    13
 * accompanied this code).
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    14
 *
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    18
 *
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    21
 * have any questions.
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    22
 */
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    23
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    24
/*
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    25
 * @test
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    26
 * @bug 6644726
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    27
 * @summary Cookie management issues
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    28
 */
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    29
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    30
import java.net.*;
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    31
import java.util.*;
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    32
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    33
public class B6644726 {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    34
    public static void main(String[] args) throws Exception {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    35
        testCookieStore();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    36
    }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    37
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    38
    private static void testCookieStore() throws Exception {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    39
        CookieManager cm = new CookieManager();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    40
        CookieStore cs = cm.getCookieStore();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    41
        URI uri = new URI("http://www.s1.sun.com/dir/foo/doc.html");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    42
        URI suri = new URI("https://www.s1.sun.com/dir/foo/index.html");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    43
        cm.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    44
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    45
        ArrayList<String> lst = new ArrayList<String>();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    46
        // Let's test the default path
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    47
        lst.add("myCookie1=foo");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    48
        // Then some alternate expires format
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    49
        lst.add("myCookie2=bar; path=/dir; expires=Tue, 19 Aug 2025 16:00:00 GMT");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    50
        lst.add("myCookie3=test; path=/dir; expires=Tue Aug 19 2025 16:00:00 GMT-0100");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    51
        // Then Netscape draft cookies and domains
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    52
        lst.add("myCookie4=test; domain=.sun.com; path=/dir/foo");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    53
        HashMap<String, List<String>> map = new HashMap<String, List<String>>();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    54
        map.put("Set-Cookie", lst);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    55
        cm.put(uri, map);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    56
        map.clear();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    57
        lst.clear();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    58
        // Test for secure tag
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    59
        lst.add("myCookie5=test; secure");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    60
        // Test for passing cookies between http and https
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    61
        map.put("Set-Cookie", lst);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    62
        cm.put(suri, map);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    63
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    64
        List<HttpCookie> cookies = cs.getCookies();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    65
        // There should be 5 cookies if all dates parsed correctly
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    66
        if (cookies.size() != 5) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    67
            fail("Should have 5 cookies. Got only "+ cookies.size() + ", expires probably didn't parse correctly");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    68
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    69
        // Check Path for first Cookie
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    70
        for (HttpCookie c : cookies) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    71
            if (c.getName().equals("myCookie1")) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    72
                if (!"/dir/foo/".equals(c.getPath())) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    73
                    fail("Default path for myCookie1 is " + c.getPath());
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    74
                }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    75
            }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    76
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    77
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    78
        HashMap<String, List<String>> emptyMap = new HashMap<String, List<String>>();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    79
        // We should get 1 Cookie: MyCookie4, because of the domain
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    80
        Map<String, List<String>>m = cm.get(new URI("http://www.s2.sun.com/dir/foo/doc2.html"),
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    81
                emptyMap);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    82
        List<String> clst = m.get("Cookie");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    83
        if (clst.size() != 1) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    84
            fail("We should have only 1 cookie, not " + clst.size());
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    85
        } else {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    86
            if (!clst.get(0).startsWith("myCookie4")) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    87
                fail("The cookie should be myCookie4, not " + clst.get(0));
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    88
            }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    89
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    90
        // We should get 4 cookies for non secure URI, and 5 for the secure one
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    91
        m = cm.get(suri, emptyMap);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    92
        clst = m.get("Cookie");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    93
        if (clst.size() != 5) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    94
            fail("Cookies didn't cross from http to https. Got only " + clst.size());
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    95
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    96
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    97
        m = cm.get(uri, emptyMap);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    98
        clst = m.get("Cookie");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
    99
        if (clst.size() != 4) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   100
            fail("We should have gotten only 4 cookies over http (non secure), got " +
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   101
                    clst.size());
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   102
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   103
        if (isIn(clst, "myCookie5=")) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   104
            // myCookie5 (the secure one) shouldn't be here
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   105
            fail("Got the secure cookie over a non secure link");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   106
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   107
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   108
        // Let's check that empty path is treated correctly
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   109
        uri = new URI("http://www.sun.com/");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   110
        lst.clear();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   111
        lst.add("myCookie6=foo");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   112
        map.clear();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   113
        map.put("Set-Cookie", lst);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   114
        cm.put(uri, map);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   115
        uri = new URI("http://www.sun.com");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   116
        m = cm.get(uri, emptyMap);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   117
        clst = m.get("Cookie");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   118
        if (clst.size() != 1) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   119
            fail("Missing a cookie when using an empty path");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   120
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   121
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   122
        // And now, the other way around:
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   123
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   124
        uri = new URI("http://www.sun.com");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   125
        lst.clear();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   126
        lst.add("myCookie7=foo");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   127
        map.clear();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   128
        map.put("Set-Cookie", lst);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   129
        cm.put(uri, map);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   130
        uri = new URI("http://www.sun.com/");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   131
        m = cm.get(uri, emptyMap);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   132
        clst = m.get("Cookie");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   133
        if (!isIn(clst, "myCookie7=")) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   134
            fail("Missing a cookie when using an empty path");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   135
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   136
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   137
        // Let's make sure the 'Port' optional attributes is enforced
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   138
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   139
        lst.clear();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   140
        lst.add("myCookie8=porttest; port");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   141
        lst.add("myCookie9=porttest; port=\"80,8000\"");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   142
        lst.add("myCookie10=porttest; port=\"8000\"");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   143
        map.clear();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   144
        map.put("Set-Cookie", lst);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   145
        uri = new URI("http://www.sun.com/");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   146
        cm.put(uri, map);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   147
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   148
        // myCookie10 should have been rejected
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   149
        cookies = cs.getCookies();
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   150
        for (HttpCookie c : cookies) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   151
            if (c.getName().equals("myCookie10")) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   152
                fail("A cookie with an invalid port list was accepted");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   153
            }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   154
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   155
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   156
        uri = new URI("http://www.sun.com:80/");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   157
        m = cm.get(uri, emptyMap);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   158
        clst = m.get("Cookie");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   159
        // We should find both myCookie8 and myCookie9 but not myCookie10
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   160
        if (!isIn(clst, "myCookie8=") || !isIn(clst, "myCookie9=")) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   161
            fail("Missing a cookie on port 80");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   162
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   163
        uri = new URI("http://www.sun.com:8000/");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   164
        m = cm.get(uri, emptyMap);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   165
        clst = m.get("Cookie");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   166
        // We should find only myCookie9
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   167
        if (!isIn(clst, "myCookie9=")) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   168
            fail("Missing a cookie on port 80");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   169
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   170
        if (isIn(clst, "myCookie8=")) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   171
            fail("A cookie with an invalid port list was returned");
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   172
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   173
    }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   174
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   175
    private static boolean isIn(List<String> lst, String cookie) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   176
        if (lst == null || lst.isEmpty()) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   177
            return false;
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   178
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   179
        for (String s : lst) {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   180
            if (s.startsWith(cookie))
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   181
                return true;
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   182
        }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   183
        return false;
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   184
    }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   185
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   186
    private static void fail(String msg) throws Exception {
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   187
        throw new RuntimeException(msg);
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   188
    }
c309ca1d3a86 6644726: Cookie management issues
jccollet
parents:
diff changeset
   189
}