private static Cookie cookie(final io.undertow.server.handlers.Cookie c) { Cookie.Definition cookie = new Cookie.Definition(c.getName(), c.getValue()); Optional.ofNullable(c.getComment()).ifPresent(cookie::comment); Optional.ofNullable(c.getDomain()).ifPresent(cookie::domain); Optional.ofNullable(c.getPath()).ifPresent(cookie::path); return cookie.toCookie(); }
header.append(DateUtils.toDateString(cookie.getExpires())); if (cookie.getComment() != null && !cookie.getComment().isEmpty()) { header.append("; Comment="); header.append(cookie.getComment());
header.append(DateUtils.toDateString(cookie.getExpires())); if (cookie.getComment() != null && !cookie.getComment().isEmpty()) { header.append("; Comment="); LegacyCookieSupport.maybeQuote(header, cookie.getComment());
String path = cookie.getPath(); String domain = cookie.getDomain(); String comment = cookie.getComment();
private static Cookie cookie(final io.undertow.server.handlers.Cookie c) { Cookie.Definition cookie = new Cookie.Definition(c.getName(), c.getValue()); Optional.ofNullable(c.getComment()).ifPresent(cookie::comment); Optional.ofNullable(c.getDomain()).ifPresent(cookie::domain); Optional.ofNullable(c.getPath()).ifPresent(cookie::path); return cookie.toCookie(); }
header.append(DateUtils.toDateString(cookie.getExpires())); if (cookie.getComment() != null && !cookie.getComment().isEmpty()) { header.append("; Comment="); header.append(cookie.getComment());
header.append(DateUtils.toDateString(cookie.getExpires())); if (cookie.getComment() != null && !cookie.getComment().isEmpty()) { header.append("; Comment="); header.append(cookie.getComment());
header.append(DateUtils.toDateString(cookie.getExpires())); if (cookie.getComment() != null && !cookie.getComment().isEmpty()) { header.append("; Comment="); LegacyCookieSupport.maybeQuote(header, cookie.getComment());
header.append(DateUtils.toDateString(cookie.getExpires())); if (cookie.getComment() != null && !cookie.getComment().isEmpty()) { header.append("; Comment="); LegacyCookieSupport.maybeQuote(header, cookie.getComment());
cookie.getExpires(), cookie.getMaxAge(), cookie.getComment(), cookie.getVersion() );
@Override public Collection<Cookie> getRequestCookies() { final Collection<io.undertow.server.handlers.Cookie> uCookies = exchange.getRequestCookies().values(); final List<Cookie> cookies = new ArrayList<>(uCookies.size()); for (final io.undertow.server.handlers.Cookie uCookie : uCookies) { final Cookie cookie = new Cookie(uCookie.getName(), uCookie.getValue()); cookie.setComment(uCookie.getComment()); cookie.setDomain(uCookie.getDomain()); cookie.setPath(uCookie.getPath()); cookie.setMaxAge(uCookie.getMaxAge() == null ? -1 : uCookie.getMaxAge()); cookie.setSecure(uCookie.isSecure()); cookie.setHttpOnly(uCookie.isHttpOnly()); cookies.add(cookie); } return cookies; }
static public ninja.Cookie convertUndertowCookieToNinjaCookie(@NotNull Cookie undertowCookie) { ninja.Cookie.Builder ninjaCookieBuilder = ninja.Cookie.builder(undertowCookie.getName(), undertowCookie.getValue()); if (undertowCookie.getMaxAge() != null) { ninjaCookieBuilder.setMaxAge(undertowCookie.getMaxAge()); } if (undertowCookie.getComment() != null) { ninjaCookieBuilder.setComment(undertowCookie.getComment()); } if (undertowCookie.getDomain() != null) { ninjaCookieBuilder.setDomain(undertowCookie.getDomain()); } if (undertowCookie.getPath() != null) { ninjaCookieBuilder.setPath(undertowCookie.getPath()); } ninjaCookieBuilder.setHttpOnly(undertowCookie.isHttpOnly()); ninjaCookieBuilder.setSecure(undertowCookie.isSecure()); // TODO: discard, version, and expires??? return ninjaCookieBuilder.build(); }
String path = cookie.getPath(); String domain = cookie.getDomain(); String comment = cookie.getComment();
String path = cookie.getPath(); String domain = cookie.getDomain(); String comment = cookie.getComment();
public static H.Cookie undertow2osgl(Cookie uc) { H.Cookie c = new H.Cookie(uc.getName(), uc.getValue()); c.domain(uc.getDomain()).httpOnly(uc.isHttpOnly()) .path(uc.getPath()).secure(uc.isSecure()) .version(uc.getVersion()).comment(uc.getComment()); Integer maxAge = uc.getMaxAge(); if (null != maxAge) { c.maxAge(maxAge); } Date exp = uc.getExpires(); if (null != exp) { c.expires(exp); } return c; }
public static H.Cookie undertow2osgl(Cookie uc) { H.Cookie c = new H.Cookie(uc.getName(), uc.getValue()); c.domain(uc.getDomain()).httpOnly(uc.isHttpOnly()) .path(uc.getPath()).secure(uc.isSecure()) .version(uc.getVersion()).comment(uc.getComment()); Integer maxAge = uc.getMaxAge(); if (null != maxAge) { c.maxAge(maxAge); } Date exp = uc.getExpires(); if (null != exp) { c.expires(exp); } return c; }