我使用这个库
http://software.dzhuvinov.com/cors-filter-configuration.html
<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
<init-param>
<param-name>cors.allowOrigin</param-name>
<param-value>*</param-value>
</init-param>
<init-param>
<param-name>cors.supportedHeaders</param-name>
<param-value>authorization,content-type,x-http-method-override</param-value>
</init-param>
<init-param>
<param-name>cors.maxAge</param-name>
<param-value>1800</param-value>
</init-param>
<init-param>
<param-name>cors.exposedHeaders</param-name>
<param-value>authorization</param-value>
</init-param>
<init-param>
<param-name>cors.supportedMethods</param-name>
<param-value>GET, POST, HEAD, PUT, DELETE, OPTIONS</param-value>
</init-param>
</filter>
<filter-mapping>
一切正常
除非我有一个返回错误代码500的内部异常:
content-length:10226
content-type:text/html;charset=UTF-8
date:Sun, 30 Apr 2017 21:44:29 GMT
status:500
GET 500内部服务器错误
如何让500个回复包含这些标题?