2013/6/4 <[email protected]>:
> Author: markt
> Date: Tue Jun 4 10:51:31 2013
> New Revision: 1489385
>
> URL: http://svn.apache.org/r1489385
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55046
> Add a Filter that implements CORS (http://www.w3.org/TR/cors/)
> Based on a patch by Mohit Soni.
>
> Added:
> tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java (with
> props)
> tomcat/trunk/test/org/apache/catalina/filters/TestCorsFilter.java (with
> props)
> tomcat/trunk/test/org/apache/catalina/filters/TesterFilterChain.java
> (with props)
> tomcat/trunk/test/org/apache/catalina/filters/TesterFilterConfigs.java
> (with props)
>
> tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java
> (with props)
> tomcat/trunk/test/org/apache/catalina/filters/TesterServletContext.java
> (with props)
> Modified:
> tomcat/trunk/java/org/apache/catalina/filters/LocalStrings.properties
>
> tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletResponse.java
> tomcat/trunk/webapps/docs/config/filter.xml
>
Two minor nits:
in CorsFilter.java and LocalStrings.properties:
> + if (preflightMaxAge != null) {
> + try {
> + if (!preflightMaxAge.isEmpty()) {
> + this.preflightMaxAge = Long.parseLong(preflightMaxAge);
> + } else {
> + this.preflightMaxAge = 0L;
> + }
> + } catch (NumberFormatException e) {
> + throw new ServletException(
> + sm.getString("corsFilter.invalidPreFlightMaxAge"),
> e);
The message key casing is inconsistent with the name of the property.
It would be "Preflight".
in filter.xml:
+ is rejected with HTTP status code 403 (Forbidden). A
+ <a href="../images/cors-flowchart.png">flowchart</a> that
+ demonstrates request processing by this filter is available.</p>
I do not see "cors-flowchart.png" among added files.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]