当前位置:Gxlcms >
数据库问题 >
Method PUT is not allowed by Access-Control-Allow-Methods in preflight response
Method PUT is not allowed by Access-Control-Allow-Methods in preflight response
时间:2021-07-01 10:21:17
帮助过:15人阅读
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
HttpServletRequest request =
(HttpServletRequest) servletRequest;
HttpServletResponse response =
(HttpServletResponse) servletResponse;
response.setHeader("Access-Control-Allow-Methods", "POST, GET, PATCH, DELETE, PUT, OPTIONS"
);
filterChain.doFilter(servletRequest, servletResponse);
}
具体的添加过程,可以参考此链接
https://www.cnblogs.com/bien94/p/13188699.html
Method PUT is not allowed by Access-Control-Allow-Methods in preflight response
标签:问题 head not div post throws col lazy ade