Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2013-05-20 01:39:30 -0400
committerJan Bartel2013-05-20 01:39:30 -0400
commit053408254efaf1d654bb977937d9476bcb8b6d2d (patch)
tree44cf1717980576e9c1aa208d0b652af0f8931f3f /jetty-servlets/src
parentb6d1158c2232d87701a3c41c15d8c0131c9e1085 (diff)
downloadorg.eclipse.jetty.project-053408254efaf1d654bb977937d9476bcb8b6d2d.tar.gz
org.eclipse.jetty.project-053408254efaf1d654bb977937d9476bcb8b6d2d.tar.xz
org.eclipse.jetty.project-053408254efaf1d654bb977937d9476bcb8b6d2d.zip
408446 Multipart parsing issue with boundry and charset in ContentType header
Diffstat (limited to 'jetty-servlets/src')
-rw-r--r--jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
index 7a18afdc75..6385551598 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/MultipartFilterTest.java
@@ -698,6 +698,39 @@ public class MultipartFilterTest
assertEquals(HttpServletResponse.SC_OK, response.getStatus());
assertTrue(response.getContent().contains("aaaa,bbbbb"));
}
+
+
+ @Test
+ public void testContentTypeWithCharSet() throws Exception
+ {
+ // generated and parsed test
+ HttpTester.Request request = HttpTester.newRequest();
+ HttpTester.Response response;
+
+ // test GET
+ request.setMethod("POST");
+ request.setVersion("HTTP/1.0");
+ request.setHeader("Host","tester");
+ request.setURI("/context/dump");
+
+ String boundary="XyXyXy";
+ request.setHeader("Content-Type","multipart/form-data; boundary=\""+boundary+"\"; charset=ISO-8859-1");
+
+
+ String content = "--" + boundary + "\r\n"+
+ "Content-Disposition: form-data; name=\"fileup\"; filename=\"test.upload\"\r\n"+
+ "Content-Type: application/octet-stream\r\n\r\n"+
+ "How now brown cow."+
+ "\r\n--" + boundary + "--\r\n\r\n";
+
+ request.setContent(content);
+
+ response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+ assertEquals(HttpServletResponse.SC_OK,response.getStatus());
+ assertTrue(response.getContent().indexOf("brown cow")>=0);
+ }
+
+
/*
* see the testParameterMap test
*

Back to the top