fixes bug in cors service (DELETE was not supported)
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/0ac19180 Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/0ac19180 Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/0ac19180 Branch: refs/heads/develop Commit: 0ac19180dfaae087cd1496dd1ef918e7014c0c4c Parents: 425e9a7 Author: tkurz <[email protected]> Authored: Thu Apr 11 23:58:56 2013 +0200 Committer: tkurz <[email protected]> Committed: Thu Apr 11 23:58:56 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/0ac19180/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/0ac19180/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>
