You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/05/15 17:41:53 UTC

[GitHub] [lucene-solr] dsmiley commented on a change in pull request #1490: SOLR-14461: Replace commons-fileupload with Jetty

dsmiley commented on a change in pull request #1490:
URL: https://github.com/apache/lucene-solr/pull/1490#discussion_r425952778



##########
File path: solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
##########
@@ -571,59 +552,99 @@ public SolrParams parseParamsAndFillStreams(
     }
   }
 
-
-
   /**
    * Extract Multipart streams
    */
   static class MultipartRequestParser implements SolrRequestParser {
-    private final int uploadLimitKB;
-    private DiskFileItemFactory factory = new DiskFileItemFactory();
-    
-    public MultipartRequestParser(int limit) {
-      uploadLimitKB = limit;
+    private final MultipartConfigElement multipartConfigElement;
 
-      // Set factory constraints
-      FileCleaningTracker fct = fileCleaningTracker;
-      if (fct != null) {
-        factory.setFileCleaningTracker(fileCleaningTracker);
-      }
-      // TODO - configure factory.setSizeThreshold(yourMaxMemorySize);
-      // TODO - configure factory.setRepository(yourTempDirectory);
+    public MultipartRequestParser(int uploadLimitKB) {
+      multipartConfigElement = new MultipartConfigElement(
+          null, // temp dir (null=default)
+          -1, // maxFileSize  (-1=none)
+          uploadLimitKB * 1024, // maxRequestSize
+          1 * 1024 * 1024 ); // fileSizeThreshold after which will go to disk

Review comment:
       ```suggestion
             100 * 1024 ); // fileSizeThreshold after which will go to disk
   ```
   Lowering to reduce DoS risk




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org