Revert "Revert "fixes bug in cors service (DELETE was not supported)""

This reverts commit a173309eeacd8607ed5f193041b80d8bdcca84a9.


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/14ed40ba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/14ed40ba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/14ed40ba

Branch: refs/heads/develop
Commit: 14ed40bac1a97c6ef10d80b30a5d48889e5c0234
Parents: a173309
Author: tkurz <[email protected]>
Authored: Fri Apr 12 00:03:40 2013 +0200
Committer: tkurz <[email protected]>
Committed: Fri Apr 12 00:03:40 2013 +0200

----------------------------------------------------------------------
 .../src/main/webapp/WEB-INF/web.xml                |   11 +++++
 .../src/main/webapp/WEB-INF/web.xml                |   33 +++++++++++----
 2 files changed, 35 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/14ed40ba/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git 
a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
 
b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
index a44d704..9a01350 100644
--- 
a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
+++ 
b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -67,6 +67,17 @@
     <filter>
         <filter-name>CORS</filter-name>
         <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
+
+        <init-param>
+            <param-name>cors.supportedMethods</param-name>
+            <param-value>GET, HEAD, POST, PUT, DELETE, OPTIONS</param-value>
+        </init-param>
+
+        <init-param>
+            <param-name>cors.supportedHeaders</param-name>
+            <param-value>Origin, Accept</param-value>
+        </init-param>
+
     </filter>
     <filter-mapping>
         <filter-name>CORS</filter-name>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/14ed40ba/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml 
b/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml
index 465a199..7c9c5f4 100644
--- a/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml
+++ b/launchers/marmotta-webapp/src/main/webapp/WEB-INF/web.xml
@@ -49,24 +49,39 @@
         <param-value>/tmp/marmotta</param-value>
     </context-param>
 
-    <!-- this filter performs startup configurations for first installation -->
+    <!-- enables a cors filter and maps it to any request -->
+    <!-- for more fine grained configuration have a look at 
http://software.dzhuvinov.com/cors-filter-configuration.html -->
+
     <filter>
-        <filter-name>MarmottaPreStartupFilter</filter-name>
-        
<filter-class>org.apache.marmotta.platform.core.servlet.MarmottaPreStartupFilter</filter-class>
+        <!-- The CORS filter with parameters -->
+        <filter-name>CORS</filter-name>
+        <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
+
+        <init-param>
+            <param-name>cors.supportedMethods</param-name>
+            <param-value>GET, HEAD, POST, PUT, DELETE, OPTIONS</param-value>
+        </init-param>
+
+        <init-param>
+            <param-name>cors.supportedHeaders</param-name>
+            <param-value>Origin, Accept</param-value>
+        </init-param>
+
     </filter>
+
     <filter-mapping>
-        <filter-name>MarmottaPreStartupFilter</filter-name>
+        <!-- CORS Filter mapping -->
+        <filter-name>CORS</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
 
-    <!-- enables a cors filter and maps it to any request -->
-    <!-- for more fine grained configuration have a look at 
http://software.dzhuvinov.com/cors-filter-configuration.html -->
+    <!-- this filter performs startup configurations for first installation -->
     <filter>
-        <filter-name>CORS</filter-name>
-        <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
+        <filter-name>MarmottaPreStartupFilter</filter-name>
+        
<filter-class>org.apache.marmotta.platform.core.servlet.MarmottaPreStartupFilter</filter-class>
     </filter>
     <filter-mapping>
-        <filter-name>CORS</filter-name>
+        <filter-name>MarmottaPreStartupFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
 

Reply via email to