我的web.xml中有以下内容
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>
org.eclipse.jetty.servlets.CrossOriginFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/cometd/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>
org.eclipse.jetty.servlets.CrossOriginFilter
</filter-class>
<async-supported>true</async-supported>
</filter>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/cometd/*</url-pattern>
</filter-mapping>
常规和异步CORS的这种双重映射大部分时间都可以工作,但随后会失败
请求的资源上没有'Access-Control-Allow-Origin'标头。
我正在使用Angular,并在我的App config
中使用它$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
有什么想法吗?