2.6, scala / play.filters.cors.exposedHeaders does not seem to have any effect.

38 views
Skip to first unread message

Igor Urisman

unread,
May 21, 2018, 12:29:01 AM5/21/18
to play-fr...@googlegroups.com
Dear players,

With these CORS filter configuration:

play.filters.cors {

   # allow all paths                                                                                                      
   pathPrefixes = ["/"]

   # allow all origins                                                                                                    
   allowedOrigins = null

   # allow the methods Variant uses.                                                                                      
   allowedHttpMethods = ["GET", "POST", "PUT", "DELETE"]

   # allow all headers                                                                                                    
   allowedHttpHeaders = null

   # Response headers which browsers will expose to JavaScript.                                                           
   exposedHeaders = ["X-Connection-ID"]
}

I am not getting the "X-Connection-ID" custom header exposed to browser AJAX (tried FF and Chrome). Specifically, this jQuery code

$.ajax({
            url: httpUrl,
            method: "post",
            contentType: "text/plain; charset=utf-8",
            success: function (respBody, status, resp) {
                console.dir(resp.getAllResponseHeaders());
            }
        });

only prints the Content-Type header.

Thanks in advance for your help.

—Igor Urisman.

Igor Urisman

unread,
May 21, 2018, 9:40:38 AM5/21/18
to play-fr...@googlegroups.com
Found the problem and it has nothing to do with Play. Everything works as expected.
Sorry for the false alarm.
—Igor.
Reply all
Reply to author
Forward
0 new messages