diff --git a/VERSION.txt b/VERSION.txt index dfec95d6887..ec6d1286579 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -4,6 +4,7 @@ jetty-7.4.4-SNAPSHOT + 350397 SelectChannelConnector does not shutdown gracefully + 351039 Forward dispatch should retain locale + 351199 HttpServletResponse.encodeURL() wrongly encodes an url without path when cookies are disabled + + JETTY-1153 Default charset/encoding of HTTP POST requests + JETTY-1380 Jetty Rewrite example does not work in Hightide jetty-7.4.3.v20110701 01 July 2011 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 a6f397dc60a..24914935709 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 @@ -507,7 +507,14 @@ public class UrlEncoded extends MultiMap public static void decodeTo(InputStream in, MultiMap map, String charset, int maxLength) throws IOException { - if (charset==null || StringUtil.__UTF8.equalsIgnoreCase(charset)) + //no charset present, use the configured default + if (charset==null) + { + charset=ENCODING; + } + + + if (StringUtil.__UTF8.equalsIgnoreCase(charset)) { decodeUtf8To(in,map,maxLength); return; diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java index 2e25a7af90a..30f70621404 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/URLEncodedTest.java @@ -19,6 +19,7 @@ import static org.junit.Assert.assertTrue; import java.io.ByteArrayInputStream; import java.io.UnsupportedEncodingException; +import org.junit.Ignore; import org.junit.Test; @@ -28,6 +29,19 @@ import org.junit.Test; */ public class URLEncodedTest { + + /* -------------------------------------------------------------- */ + static + { + /* + * Uncomment to set setting the System property to something other than the default of UTF-8. + * Beware however that you will have to @Ignore all the other tests other than testUrlEncodedStream! + + System.setProperty("org.eclipse.jetty.util.UrlEncoding.charset", StringUtil.__ISO_8859_1); + */ + } + + /* -------------------------------------------------------------- */ @Test public void testUrlEncoded() throws UnsupportedEncodingException @@ -160,6 +174,7 @@ public class URLEncodedTest {StringUtil.__UTF16,StringUtil.__UTF16}, }; + for (int i=0;i