@Test public void illegalCharInCookieValueMakesStrictEncoderThrowsException() { Set<Character> illegalChars = new HashSet<Character>(); for (int i = 0x00; i <= 0x1F; i++) { illegalChars.add((char) i); } illegalChars.add((char) 0x7F); for (char c : new char[] { ' ', '"', ',', ';', '\\' }) { illegalChars.add(c); } int exceptions = 0; for (char c : illegalChars) { try { ServerCookieEncoder.STRICT.encode(new DefaultCookie("name", "value" + c)); } catch (IllegalArgumentException e) { exceptions++; } } assertEquals(illegalChars.size(), exceptions); }
public String encode(String name, String value) { return encode(new DefaultCookie(name, value)); }
ServerCookieEncoder extends CookieEncoder { public String encode(String name, String value) { return encode(new DefaultCookie(name, value)); } }
ServerCookieEncoder extends CookieEncoder { public String encode(String name, String value) { return encode(new DefaultCookie(name, value)); } private  ServerCookieEncoder(boolean strict); }
ServerCookieEncoder extends CookieEncoder { public String encode(String name, String value) { return encode(new DefaultCookie(name, value)); } private  ServerCookieEncoder(boolean strict); String encode(String name, String value); String encode(Cookie cookie); List<String> encode(Cookie... cookies); List<String> encode(Collection<? extends Cookie> cookies); List<String> encode(Iterable<? extends Cookie> cookies); }
ServerCookieEncoder extends CookieEncoder { public String encode(String name, String value) { return encode(new DefaultCookie(name, value)); } private  ServerCookieEncoder(boolean strict); String encode(String name, String value); String encode(Cookie cookie); List<String> encode(Cookie... cookies); List<String> encode(Collection<? extends Cookie> cookies); List<String> encode(Iterable<? extends Cookie> cookies); static final ServerCookieEncoder STRICT; static final ServerCookieEncoder LAX; }