Four years after its inception it was time for a new major 2.0 release of the CORS Filter that enables Java web applications to handle cross-domain requests according to the W3C spec for Cross-Origin Resource Sharing.
What are the highlights of the new 2.0 version?
- The minimum Servlet API requirement is now raised to version 3.0 (from 2.5). This enables the CORS Filter to handle asynchronous requests which was asked for by a number of developers.
- HTTP response wrapper was added to preserve the CORS response headers on
ServletResponse.reset()
. Some web applications and frameworks (e.g. RestEasy) reset the servlet response when a HTTP 4xx error is produced. The wrapper ensures previously set CORS headers survive such a reset. The credits for this patch go to Gervasio Amy from Argentina.
The new release was pushed to Maven Central and should be available from there by tomorrow.
<groupId>com.thetransactioncompany</groupId> <artifactId>cors-filter</artifactId> <version>2.0</version>