CORS preflight requests support

35 views
Skip to first unread message

victo...@gmail.com

unread,
Apr 7, 2015, 4:40:09 PM4/7/15
to membrane...@googlegroups.com
Does membrane provide any built-in support for the AJAX preflight CORS requests? e.g. we want to allow any CORS requests originated from *.abc.com.

Thanks in advance...

Thomas Bayer

unread,
Apr 14, 2015, 11:34:01 AM4/14/15
to membrane...@googlegroups.com, victo...@gmail.com
Hi Victor,
there is no built-in support for preflight CORS requests but you can realize it very easily by a groovy interceptor:

 <serviceProxy method="OPTIONS" port="8080">
 <request>
 <groovy>
 def response = Response.ok().build()
 response.header.add("Access-Control-Allow-Origin", "*");
 response.header.add("Access-Control-Allow-Credentials", "true");
 response.header.add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
 response
 </groovy>
 </request>
 </serviceProxy>


Cheers,
Thomas
Reply all
Reply to author
Forward
0 new messages