tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1489385 [1/3] - in /tomcat/trunk: java/org/apache/catalina/filters/ test/org/apache/catalina/filters/ webapps/docs/config/
Date Tue, 04 Jun 2013 11:13:22 GMT
2013/6/4  <markt@apache.org>:
> 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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message