tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r1294280 - in /tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime: META-INF/MANIFEST.MF src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
Date Mon, 27 Feb 2012 19:08:38 GMT
Author: lresende
Date: Mon Feb 27 19:08:38 2012
New Revision: 1294280

URL: http://svn.apache.org/viewvc?rev=1294280&view=rev
Log:
Adding more generic support for CORS into the runtime of REST binding

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF
    tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF?rev=1294280&r1=1294279&r2=1294280&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF Mon Feb 27
19:08:38 2012
@@ -22,6 +22,7 @@ Import-Package: javax.jws,
  org.apache.tuscany.sca.binding.rest.wireformat.json;version="2.0.0",
  org.apache.tuscany.sca.binding.rest.wireformat.xml;version="2.0.0",
  org.apache.tuscany.sca.common.http;version="2.0.0",
+ org.apache.tuscany.sca.common.http.cors;version="2.0.0",
  org.apache.tuscany.sca.core;version="2.0.0",
  org.apache.tuscany.sca.core.invocation;version="2.0.0",
  org.apache.tuscany.sca.databinding;version="2.0.0",

Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java?rev=1294280&r1=1294279&r2=1294280&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
Mon Feb 27 19:08:38 2012
@@ -45,6 +45,7 @@ import org.apache.tuscany.sca.common.htt
 import org.apache.tuscany.sca.common.http.HTTPContext;
 import org.apache.tuscany.sca.common.http.HTTPHeader;
 import org.apache.tuscany.sca.common.http.ThreadHTTPContext;
+import org.apache.tuscany.sca.common.http.cors.CORSHeaderProcessor;
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.extensibility.ClassLoaderContext;
 import org.apache.wink.common.internal.registry.ProvidersRegistry;
@@ -81,6 +82,7 @@ public class TuscanyRESTServlet extends 
     protected void service(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
         
         if (binding.isCORS()) {
+            /*
             response.setHeader("Access-Control-Allow-Origin", "*");
             response.setHeader("Access-Control-Allow-Headers", "X-Requested-With");
             if (request.getMethod().equals("OPTIONS")) {
@@ -88,6 +90,9 @@ public class TuscanyRESTServlet extends 
                 response.setHeader("Access-Control-Max-Age", "1728000");
                 return;
             }
+            */
+            
+            CORSHeaderProcessor.processCORS(binding.getCORSConfiguration(), request, response);
         }
 
         //create context



Mime
View raw message