From 8dc3627d42d44231714168a3f8e70c26c5fe540a Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 25 Oct 2017 10:56:13 +1100 Subject: [PATCH] Fix #1898 Ignore bad cookies in getCookie --- .../org/eclipse/jetty/server/Cookies.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Cookies.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Cookies.java index 7e1b26a1577..f141e76f847 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Cookies.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Cookies.java @@ -122,16 +122,23 @@ public class Cookies extends CookieCutter @Override protected void addCookie(String name, String value, String domain, String path, int version, String comment) { - Cookie cookie = new Cookie(name,value); - if (domain!=null) - cookie.setDomain(domain); - if (path!=null) - cookie.setPath(path); - if (version>0) - cookie.setVersion(version); - if (comment!=null) - cookie.setComment(comment); - _cookieList.add(cookie); + try + { + Cookie cookie = new Cookie(name,value); + if (domain!=null) + cookie.setDomain(domain); + if (path!=null) + cookie.setPath(path); + if (version>0) + cookie.setVersion(version); + if (comment!=null) + cookie.setComment(comment); + _cookieList.add(cookie); + } + catch(Exception e) + { + LOG.debug(e); + } } }