springboot增加content-length

package com.tianrang.vcc.controller.filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.ShallowEtagHeaderFilter;

import java.util.Arrays;

@Configuration
public class FilterConfig {

  @Bean
  public FilterRegistrationBean filterRegistrationBean() {
    FilterRegistrationBean filterBean = new FilterRegistrationBean();
    filterBean.setFilter(new ShallowEtagHeaderFilter());
    filterBean.setUrlPatterns(Arrays.asList("*"));
    return filterBean;
  }

}
posted @ 2022-07-28 16:02  疯子110  阅读(976)  评论(1编辑  收藏  举报