828cdb
--- java/org/apache/catalina/filters/CorsFilter.java.orig	2017-10-12 16:48:47.426952298 -0400
828cdb
+++ java/org/apache/catalina/filters/CorsFilter.java	2017-10-12 16:48:47.431952269 -0400
828cdb
@@ -297,6 +297,10 @@
828cdb
                     exposedHeadersString);
828cdb
         }
828cdb
 
828cdb
+        // Indicate the response depends on the origin
828cdb
+        response.addHeader(CorsFilter.REQUEST_HEADER_VARY,
828cdb
+                CorsFilter.REQUEST_HEADER_ORIGIN);
828cdb
+
828cdb
         // Forward the request down the filter chain.
828cdb
         filterChain.doFilter(request, response);
828cdb
     }
828cdb
@@ -998,6 +1002,13 @@
828cdb
             "Access-Control-Allow-Headers";
828cdb
 
828cdb
     // -------------------------------------------------- CORS Request Headers
828cdb
+
828cdb
+    /**
828cdb
+     * The Vary header indicates allows disabling proxy caching by indicating
828cdb
+     * the the response depends on the origin.
828cdb
+     */
828cdb
+    public static final String REQUEST_HEADER_VARY = "Vary";
828cdb
+
828cdb
     /**
828cdb
      * The Origin header indicates where the cross-origin request or preflight
828cdb
      * request originates from.
828cdb
--- webapps/docs/changelog.xml.orig	2017-10-12 16:48:47.428952287 -0400
828cdb
+++ webapps/docs/changelog.xml	2017-10-12 16:50:08.718477877 -0400
828cdb
@@ -57,6 +57,16 @@
828cdb
   They eventually become mixed with the numbered issues. (I.e., numbered
828cdb
   issues do not "pop up" wrt. others).
828cdb
 -->
828cdb
+<section name="Tomcat 7.0.76-3 (csutherl)">
828cdb
+  <subsection name="Catalina">
828cdb
+    <changelog>
828cdb
+      <fix>
828cdb
+        <bug>61101</bug>: CORS filter should set Vary header in response.
828cdb
+        Submitted by Rick Riemer. (remm)
828cdb
+      </fix>
828cdb
+    </changelog>
828cdb
+  </subsection>
828cdb
+</section>
828cdb
 <section name="Tomcat 7.0.76-2 (csutherl)">
828cdb
   <subsection name="Catalina">
828cdb
     <changelog>