sullis 2002/10/27 09:11:48
Modified: fileupload/src/java/org/apache/commons/fileupload
FileUpload.java
Log:
improved exception handling for unexpected content type values
Revision Changes Path
1.13 +11 -7
jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileUpload.java
Index: FileUpload.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileUpload.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- FileUpload.java 26 Oct 2002 22:22:29 -0000 1.12
+++ FileUpload.java 27 Oct 2002 17:11:46 -0000 1.13
@@ -361,10 +361,14 @@
ArrayList items = new ArrayList();
String contentType = req.getHeader(CONTENT_TYPE);
- if (!contentType.startsWith(MULTIPART))
+ if ( (null == contentType) || (!contentType.startsWith(MULTIPART)) )
{
- throw new FileUploadException("the request doesn't contain a " +
- MULTIPART_FORM_DATA + " or " + MULTIPART_MIXED + " stream");
+ throw new FileUploadException("the request doesn't contain a "
+ + MULTIPART_FORM_DATA
+ + " or "
+ + MULTIPART_MIXED
+ + " stream, content type header is "
+ + contentType);
}
int requestSize = req.getContentLength();
--
To unsubscribe, e-mail: <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>