mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
WW-4818 added a couple of simple tests for MULTIPART_FORM_DATA_REGEX
This commit is contained in:
@@ -146,6 +146,32 @@ public class DispatcherTest extends StrutsInternalTestCase {
|
||||
assertTrue(wrapped instanceof MultiPartRequestWrapper);
|
||||
}
|
||||
|
||||
public void testPrepareMultipartRequestAllAllowedCharacters() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest();
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
|
||||
req.setMethod("post");
|
||||
req.setContentType("multipart/form-data; boundary=01=23a.bC:D((e)d'z?p+o_r,e-");
|
||||
Dispatcher du = initDispatcher(Collections.<String, String>emptyMap());
|
||||
du.prepare(req, res);
|
||||
HttpServletRequest wrapped = du.wrapRequest(req);
|
||||
|
||||
assertTrue(wrapped instanceof MultiPartRequestWrapper);
|
||||
}
|
||||
|
||||
public void testPrepareMultipartRequestIllegalCharacter() throws Exception {
|
||||
MockHttpServletRequest req = new MockHttpServletRequest();
|
||||
MockHttpServletResponse res = new MockHttpServletResponse();
|
||||
|
||||
req.setMethod("post");
|
||||
req.setContentType("multipart/form-data; boundary=01=2;3a.bC:D((e)d'z?p+o_r,e-");
|
||||
Dispatcher du = initDispatcher(Collections.<String, String>emptyMap());
|
||||
du.prepare(req, res);
|
||||
HttpServletRequest wrapped = du.wrapRequest(req);
|
||||
|
||||
assertFalse(wrapped instanceof MultiPartRequestWrapper);
|
||||
}
|
||||
|
||||
public void testDispatcherListener() throws Exception {
|
||||
|
||||
final DispatcherListenerState state = new DispatcherListenerState();
|
||||
|
||||
Reference in New Issue
Block a user