Commit 0b7ebdb7 authored by 赵啸非's avatar 赵啸非

提交配置校验

parent 431bff63
package com.mortals.xhx.base.framework.filter; package com.mortals.xhx.base.framework.filter;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpStatus;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
...@@ -53,7 +54,7 @@ public class SameSiteCookieFilter implements Filter { ...@@ -53,7 +54,7 @@ public class SameSiteCookieFilter implements Filter {
if(trustReferers.contains(referer)) { if(trustReferers.contains(referer)) {
chain.doFilter(request, response); chain.doFilter(request, response);
}else { }else {
httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "CSRF protection"); httpResponse.setStatus(HttpStatus.HTTP_BAD_REQUEST);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment