package com.twitter.finagle.http.filter

/** Adds headers to support Cross-origin resource sharing */
object CorsFilter {
  def apply(origin:  String = "*",
            methods: String = "GET",
            headers: String = "x-requested-with",
            exposes: String = "") = new AddResponseHeadersFilter(Map(
    "Access-Control-Allow-Origin"  -> origin,
    "Access-Control-Allow-Methods" -> methods,
    "Access-Control-Allow-Headers" -> headers,
    "Access-Control-Expose-Headers" -> exposes))
}

package com.twitter.finagle.http.filter

/** Adds headers to support Cross-origin resource sharing */
object CorsFilter {
  def apply(origin:  String = "*",
            methods: String = "GET",
            headers: String = "x-requested-with") = new AddResponseHeadersFilter(Map(
    "Access-Control-Allow-Origin"  -> origin,
    "Access-Control-Allow-Methods" -> methods,
    "Access-Control-Allow-Headers" -> headers))
}

--- 
+++ 
@@ -4,8 +4,10 @@
 object CorsFilter {
   def apply(origin:  String = "*",
             methods: String = "GET",
-            headers: String = "x-requested-with") = new AddResponseHeadersFilter(Map(
+            headers: String = "x-requested-with",
+            exposes: String = "") = new AddResponseHeadersFilter(Map(
     "Access-Control-Allow-Origin"  -> origin,
     "Access-Control-Allow-Methods" -> methods,
-    "Access-Control-Allow-Headers" -> headers))
+    "Access-Control-Allow-Headers" -> headers,
+    "Access-Control-Expose-Headers" -> exposes))
 }
[split] Add Access-Control-Expose-Headers to Finagle CORSFilter

RB_ID=180993
