update MyFilter.java
This commit is contained in:
parent
36ccf782bd
commit
256899fa06
|
|
@ -33,4 +33,9 @@ public class SystemGlobal {
|
|||
*/
|
||||
public final static String POST="POST";
|
||||
|
||||
/**
|
||||
* PUT 请求
|
||||
*/
|
||||
public final static String PUT="PUT";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,16 +19,13 @@ import java.io.IOException;
|
|||
import static cn.hutool.http.Method.POST;
|
||||
import static jdk.nashorn.internal.runtime.PropertyDescriptor.GET;
|
||||
|
||||
/**
|
||||
* @author bonus
|
||||
*/
|
||||
@Component
|
||||
@WebFilter("/*")
|
||||
public class MyFilter extends OncePerRequestFilter {
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
|
||||
if (SystemGlobal.POST.equals(request.getMethod())){
|
||||
if (SystemGlobal.POST.equals(request.getMethod()) || SystemGlobal.PUT.equals(request.getMethod()) ){
|
||||
//去除文件上传
|
||||
String header = request.getHeader(HttpHeaders.CONTENT_TYPE);
|
||||
if(StringUtils.isNotEmpty(header)){
|
||||
|
|
|
|||
Loading…
Reference in New Issue