Author: markt
Date: Thu Sep 12 13:15:38 2013
New Revision: 1522563
URL: http://svn.apache.org/r1522563
Log:
Apply clarification from the Servlet EG.
Attempting to parse parts when no multi-part configuration has been provided
will trigger an ISE.
Modified:
tomcat/trunk/java/org/apache/catalina/connector/Request.java
Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1522563&r1=1522562&r2=1522563&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Sep 12
13:15:38 2013
@@ -2535,7 +2535,7 @@ public class Request
public Collection<Part> getParts() throws IOException,
IllegalStateException,
ServletException {
- parseParts();
+ parseParts(true);
if (partsParseException != null) {
if (partsParseException instanceof IOException) {
@@ -2550,7 +2550,7 @@ public class Request
return parts;
}
- private void parseParts() {
+ private void parseParts(boolean explicit) {
// Return immediately if the parts have already been parsed
if (parts != null || partsParseException != null) {
@@ -2566,8 +2566,14 @@ public class Request
connector.getMaxPostSize(),
connector.getMaxPostSize());
} else {
- parts = Collections.emptyList();
- return;
+ if (explicit) {
+ partsParseException = new IllegalStateException(
+ sm.getString("coyoteRequest.noMultipartConfig"));
+ return;
+ } else {
+ parts = Collections.emptyList();
+ return;
+ }
}
}
@@ -2928,7 +2934,7 @@ public class Request
}
if ("multipart/form-data".equals(contentType)) {
- parseParts();
+ parseParts(false);
success = true;
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]