From 979d6dbbf9416b1a0ad965e2b8a3b11a2d208627 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Sat, 8 Dec 2012 10:03:50 +1100 Subject: [PATCH] 367638 throw exception for excess form keys --- .../java/org/eclipse/jetty/util/UrlEncoded.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java index 05bd29686a7..b1a47f6c3a3 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java @@ -224,10 +224,7 @@ public class UrlEncoded extends MultiMap implements Cloneable key = null; value=null; if (maxKeys>0 && map.size()>maxKeys) - { - LOG.warn("maxFormKeys limit exceeded keys>{}",maxKeys); - return; - } + throw new IllegalStateException("Form too many keys"); break; case '=': if (key!=null) @@ -396,10 +393,7 @@ public class UrlEncoded extends MultiMap implements Cloneable key = null; value=null; if (maxKeys>0 && map.size()>maxKeys) - { - LOG.warn("maxFormKeys limit exceeded keys>{}",maxKeys); - return; - } + throw new IllegalStateException("Form too many keys"); break; case '=': @@ -483,10 +477,7 @@ public class UrlEncoded extends MultiMap implements Cloneable key = null; value=null; if (maxKeys>0 && map.size()>maxKeys) - { - LOG.warn("maxFormKeys limit exceeded keys>{}",maxKeys); - return; - } + throw new IllegalStateException("Form too many keys"); break; case '=': @@ -611,6 +602,8 @@ public class UrlEncoded extends MultiMap implements Cloneable } key = null; value=null; + if (maxKeys>0 && map.size()>maxKeys) + throw new IllegalStateException("Form too many keys"); break; case '=': if (key!=null)