[httpv2] Spring boot http upload file maximum limit parameterization (#6013)
spring.servlet.multipart.max-file-size and spring.servlet.multipart.max-request-size Configurable
This commit is contained in:
@ -129,6 +129,8 @@ public class PaloFe {
|
||||
} else {
|
||||
org.apache.doris.httpv2.HttpServer httpServer2 = new org.apache.doris.httpv2.HttpServer();
|
||||
httpServer2.setPort(Config.http_port);
|
||||
httpServer2.setMaxFileSize(Config.http_max_file_size);
|
||||
httpServer2.setMaxRequestSize(Config.http_max_file_size);
|
||||
httpServer2.start(dorisHomeDir);
|
||||
}
|
||||
|
||||
|
||||
@ -325,6 +325,12 @@ public class Config extends ConfigBase {
|
||||
*/
|
||||
@ConfField public static int http_backlog_num = 1024;
|
||||
|
||||
/**
|
||||
*Maximum file limit for single upload of web request, default value: 100M
|
||||
*/
|
||||
@ConfField public static String http_max_file_size = "100M";
|
||||
@ConfField public static String http_max_request_size = "100M";
|
||||
|
||||
/**
|
||||
* The backlog_num for mysql nio server
|
||||
* When you enlarge this backlog_num, you should enlarge the value in
|
||||
|
||||
@ -34,6 +34,17 @@ import java.util.Map;
|
||||
public class HttpServer extends SpringBootServletInitializer {
|
||||
|
||||
private int port;
|
||||
//The maximum file limit for a single upload of a web request
|
||||
private String maxFileSize;
|
||||
private String maxRequestSize;
|
||||
|
||||
public void setMaxFileSize(String maxFileSize) {
|
||||
this.maxFileSize = maxFileSize;
|
||||
}
|
||||
|
||||
public void setMaxRequestSize(String maxRequestSize) {
|
||||
this.maxRequestSize = maxRequestSize;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
@ -52,10 +63,8 @@ public class HttpServer extends SpringBootServletInitializer {
|
||||
properties.put("spring.http.encoding.charset", "UTF-8");
|
||||
properties.put("spring.http.encoding.enabled", true);
|
||||
properties.put("spring.http.encoding.force", true);
|
||||
// properties.put("spring.http.multipart.maxFileSize", "100Mb");
|
||||
// properties.put("spring.http.multipart.maxRequestSize", "100Mb");
|
||||
properties.put("spring.servlet.multipart.max-file-size", "100MB");
|
||||
properties.put("spring.servlet.multipart.max-request-size", "100MB");
|
||||
properties.put("spring.servlet.multipart.max-file-size", this.maxFileSize);
|
||||
properties.put("spring.servlet.multipart.max-request-size", this.maxRequestSize);
|
||||
properties.put("logging.config", dorisHome + "/conf/" + SpringLog4j2Config.SPRING_LOG_XML_FILE);
|
||||
new SpringApplicationBuilder()
|
||||
.sources(HttpServer.class)
|
||||
|
||||
Reference in New Issue
Block a user