Apache Sling URL Rewriter

Clone this repo:
  1. 3a42b74 SLING-11709 - Set up Jira autolinks to all Sling Github projects by Robert Munteanu · 9 weeks ago master
  2. 3b04b46 SLING-11051 - Fixing JavaDoc badge by Dan Klco · 1 year, 5 months ago
  3. d9a36da SLING-10676 - remove SECURITY.md which is not needed by Bertrand Delacretaz · 1 year, 10 months ago
  4. dec515e SLING-10676 - add or update SECURITY.md by Bertrand Delacretaz · 1 year, 11 months ago
  5. 6aaa128 Adding sonarqube badges as per SLING-9682 by Dan Klco · 2 years, 10 months ago

Apache Sling

Build Status Coverage Sonarcloud Status JavaDoc Maven Central Contrib License

Apache Sling URL Rewriter

This module is part of the Apache Sling project.

multi-purpose service for altering HTTP requests/responses based on Tuckey's UrlRewriteFilter

example for setting a Cache-Control header:

<?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">
    <set type="response-header" name="Cache-Control">max-age=600</set>

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">
    <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>