AEM 6.1. Referrer Filter - Regexp not working | Community
Skip to main content
March 15, 2016

AEM 6.1. Referrer Filter - Regexp not working

  • March 15, 2016
  • 2 replies
  • 2639 views

HI everyone,

 

AEM 6.1.   

 

I get a 403 Forbidden, on a Post action, because the referrer host is not allowed. My referrer host is:  subdomain.domain.com

So I added in the config :

    org.apache.sling.security.impl.ReferrerFilter.config

    allow.hosts.regexp=[".*"]

This works as it should, but it leaves it quiet open and I try to narrow it down. But every single regex is not working:

    allow.hosts.regexp=[".*\.domain\.com"]

    allow.hosts.regexp=[".*.domain.com"]

    allow.hosts.regexp=["(.*)\.domain\.com"]

Is this a bug or do I use the wrong regex flavor? How can I narrow it down to  *.domain.com?

 

Kind regards,

 

Jerry

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

smacdonald2008
Level 10
March 15, 2016

See The Sling Referrer Filter topic in this AEM Doc topic: 

https://docs.adobe.com/content/docs/en/aem/6-1/administer/security/security-checklist.html

October 6, 2017

When adding the config via OSGI configuration console (manually), add it as

If you save that you'll notice it will be saved as

Which is the correct string for java's Paterrn#compile

Basically, if you are adding config via config files, as you should, you should add it as: