@Test public void parseHttpOnlyFalse() { String headerValue = "name=value;"; SetCookieField setCookieField = SetCookieField.fromHeaderValue(headerValue); assertNull(setCookieField.httpOnly); }
public static final SetCookieField fromHeaderValue(String header) { StringTokenizer s = new StringTokenizer(header); NameValue nameValue = NameValue.parse(s.nextToken(";")); String domain = null; String path = null; String expiration = null; Boolean secure = null; Boolean httpOnly = null; while (s.hasMoreTokens()) { String next = s.nextToken(";"); if (next != null) { next = next.trim(); if (next.equalsIgnoreCase("Secure")) { secure = true; } else if (next.equalsIgnoreCase("HttpOnly")) { httpOnly = true; } else { NameValue property = NameValue.parse(next.trim()); String name = property.name.toLowerCase(); if (name.equals("domain")) { domain = property.value; } else if (name.equals("path")) { path = property.value; } else if (name.equals("expires")) { expiration = property.value; } } } } return new SetCookieField(nameValue.name, nameValue.value, domain, path, expiration, secure, httpOnly); }
SetCookieField extends HeaderField { public static final SetCookieField fromHeaderValue(String header) { StringTokenizer s = new StringTokenizer(header); NameValue nameValue = NameValue.parse(s.nextToken(";")); String domain = null; String path = null; String expiration = null; Boolean secure = null; Boolean httpOnly = null; while (s.hasMoreTokens()) { String next = s.nextToken(";"); if (next != null) { next = next.trim(); if (next.equalsIgnoreCase("Secure")) { secure = true; } else if (next.equalsIgnoreCase("HttpOnly")) { httpOnly = true; } else { NameValue property = NameValue.parse(next.trim()); String name = property.name.toLowerCase(); if (name.equals("domain")) { domain = property.value; } else if (name.equals("path")) { path = property.value; } else if (name.equals("expires")) { expiration = property.value; } } } } return new SetCookieField(nameValue.name, nameValue.value, domain, path, expiration, secure, httpOnly); } }
SetCookieField extends HeaderField { public static final SetCookieField fromHeaderValue(String header) { StringTokenizer s = new StringTokenizer(header); NameValue nameValue = NameValue.parse(s.nextToken(";")); String domain = null; String path = null; String expiration = null; Boolean secure = null; Boolean httpOnly = null; while (s.hasMoreTokens()) { String next = s.nextToken(";"); if (next != null) { next = next.trim(); if (next.equalsIgnoreCase("Secure")) { secure = true; } else if (next.equalsIgnoreCase("HttpOnly")) { httpOnly = true; } else { NameValue property = NameValue.parse(next.trim()); String name = property.name.toLowerCase(); if (name.equals("domain")) { domain = property.value; } else if (name.equals("path")) { path = property.value; } else if (name.equals("expires")) { expiration = property.value; } } } } return new SetCookieField(nameValue.name, nameValue.value, domain, path, expiration, secure, httpOnly); } SetCookieField(String name, String value, String domain, String path,
                          DateTimeRFC6265 expiration, Boolean secure, Boolean httpOnly);  SetCookieField(String name, String value, String domain, String path,
                          String expiration, Boolean secure, Boolean httpOnly);  SetCookieField(String name, String value, String domain, String path,
                          String expiration, Boolean secure);  SetCookieField(String name, String value, String domain); }
SetCookieField extends HeaderField { public static final SetCookieField fromHeaderValue(String header) { StringTokenizer s = new StringTokenizer(header); NameValue nameValue = NameValue.parse(s.nextToken(";")); String domain = null; String path = null; String expiration = null; Boolean secure = null; Boolean httpOnly = null; while (s.hasMoreTokens()) { String next = s.nextToken(";"); if (next != null) { next = next.trim(); if (next.equalsIgnoreCase("Secure")) { secure = true; } else if (next.equalsIgnoreCase("HttpOnly")) { httpOnly = true; } else { NameValue property = NameValue.parse(next.trim()); String name = property.name.toLowerCase(); if (name.equals("domain")) { domain = property.value; } else if (name.equals("path")) { path = property.value; } else if (name.equals("expires")) { expiration = property.value; } } } } return new SetCookieField(nameValue.name, nameValue.value, domain, path, expiration, secure, httpOnly); } SetCookieField(String name, String value, String domain, String path,
                          DateTimeRFC6265 expiration, Boolean secure, Boolean httpOnly);  SetCookieField(String name, String value, String domain, String path,
                          String expiration, Boolean secure, Boolean httpOnly);  SetCookieField(String name, String value, String domain, String path,
                          String expiration, Boolean secure);  SetCookieField(String name, String value, String domain); static final SetCookieField fromHeaderValue(String header); boolean isSecure(); DateTimeRFC6265 parsedExpiration(); @Override T accept(HeaderFieldVisitor<T> visitor); @Override String name(); @Override String value(); @Override String toString(); boolean isHttpOnly(); }
SetCookieField extends HeaderField { public static final SetCookieField fromHeaderValue(String header) { StringTokenizer s = new StringTokenizer(header); NameValue nameValue = NameValue.parse(s.nextToken(";")); String domain = null; String path = null; String expiration = null; Boolean secure = null; Boolean httpOnly = null; while (s.hasMoreTokens()) { String next = s.nextToken(";"); if (next != null) { next = next.trim(); if (next.equalsIgnoreCase("Secure")) { secure = true; } else if (next.equalsIgnoreCase("HttpOnly")) { httpOnly = true; } else { NameValue property = NameValue.parse(next.trim()); String name = property.name.toLowerCase(); if (name.equals("domain")) { domain = property.value; } else if (name.equals("path")) { path = property.value; } else if (name.equals("expires")) { expiration = property.value; } } } } return new SetCookieField(nameValue.name, nameValue.value, domain, path, expiration, secure, httpOnly); } SetCookieField(String name, String value, String domain, String path,
                          DateTimeRFC6265 expiration, Boolean secure, Boolean httpOnly);  SetCookieField(String name, String value, String domain, String path,
                          String expiration, Boolean secure, Boolean httpOnly);  SetCookieField(String name, String value, String domain, String path,
                          String expiration, Boolean secure);  SetCookieField(String name, String value, String domain); static final SetCookieField fromHeaderValue(String header); boolean isSecure(); DateTimeRFC6265 parsedExpiration(); @Override T accept(HeaderFieldVisitor<T> visitor); @Override String name(); @Override String value(); @Override String toString(); boolean isHttpOnly(); final String name; final String value; final String domain; final String path; final String expiration; final Boolean secure; final Boolean httpOnly; }