content: package com.jerry.poetry;
  
  import org.apache.coyote.http11.AbstractHttp11Protocol;
  import org.springframework.boot.Banner;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
  import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
  import org.springframework.cache.annotation.EnableCaching;
  import org.springframework.context.annotation.Bean;
  import org.springframework.scheduling.annotation.EnableAsync;
  
  @EnableAsync
  @EnableCaching
  @SpringBootApplication
  public class PoetryApplication {
  
      public static void main(String[] args) {
  //        SpringApplication.run(PoetryApplication.class, args);
          SpringApplication app = new SpringApplication(PoetryApplication.class);
          app.setBannerMode(Banner.Mode.OFF);//关闭初始化图形
          app.run(args);
      }
  
  //    //Tomcat large file upload connection reset
  //    @Bean
  //    public TomcatEmbeddedServletContainerFactory tomcatEmbedded1() {
  //        TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
  //        tomcat.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> {
  //            if ((connector.getProtocolHandler() instanceof AbstractHttp11Protocol<?>)) {
  //                //-1 means unlimited
  //                ((AbstractHttp11Protocol<?>) connector.getProtocolHandler()).setMaxSwallowSize(-1);
  //            }
  //        });
  //        return tomcat;
  //    }
  
      //Tomcat large file upload connection reset
      @Bean
      public TomcatServletWebServerFactory tomcatEmbedded() {
          TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
          tomcat.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> {
              if ((connector.getProtocolHandler() instanceof AbstractHttp11Protocol<?>)) {
                  //-1 means unlimited
                  ((AbstractHttp11Protocol<?>) connector.getProtocolHandler()).setMaxSwallowSize(-1);
              }
          });
          return tomcat;
      }
  
  }
  