This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.urlrewriter-0.0.2
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-urlrewriter.git

commit 029dd0601bd723e3ba69faab4220fa96f964f127
Author: Oliver Lietz <[email protected]>
AuthorDate: Sat Feb 14 16:52:22 2015 +0000

    SLING-3518 add a multipurpose filter based on Tuckey's UrlRewriteFilter
    
    * add example for setting CORS headers
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/urlrewriter@1659812
 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/README.md b/README.md
index be81b6b..8e996bd 100644
--- a/README.md
+++ b/README.md
@@ -17,3 +17,25 @@ example for setting a Cache-Control header:
       </rule>
     </urlrewrite>
 
+example for setting CORS headers:
+
+    <?xml version="1.0" encoding="UTF-8"?>
+    <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN" 
"http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd";>
+    <urlrewrite>
+      <rule>
+        <note>
+          http://www.w3.org/TR/cors/
+          https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
+          http://fetch.spec.whatwg.org
+          http://enable-cors.org
+          http://www.html5rocks.com/en/tutorials/cors/
+        </note>
+        <condition type="header" name="Origin">.*</condition>
+        <condition type="header" 
name="Access-Control-Request-Method">.*</condition>
+        <condition type="header" 
name="Access-Control-Request-Headers">.*</condition>
+        <set type="response-header" 
name="Access-Control-Allow-Origin">%{header:Origin}</set>
+        <set type="response-header" 
name="Access-Control-Allow-Methods">%{header:Access-Control-Request-Method}</set>
+        <set type="response-header" 
name="Access-Control-Allow-Headers">%{header:Access-Control-Request-Headers}</set>
+        <set type="response-header" 
name="Access-Control-Allow-Credentials">true</set>
+      </rule>
+    </urlrewrite>

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to