Expand my Community achievements bar.

SOLVED

Apache Sling Content Disposition Filter

Avatar

Community Advisor

Hi Team,

 

I have couple of queries regarding the Apache Content Disposition Filter - 

 

1. I have a robots.txt file in /content/dam/abc/robots.txt location.

I have added the same in Excluded Resource Paths as shown below - 

rohangargTA_1-1659685368140.png

 

When the "Enable For All Resource Paths" is checked/enabled the robots.txt is downloading even though the Excluded Resource Paths has the entry.

When the "Enable For All Resource Paths" is unchecked only then the robots.txt is displaying in browser.

Can anyone please explain why this behaving this way ?
Ideally the Enable for All Resource Paths should be checked and even then the file should open in browser.

 

2. What is the default value for Enable for All Resource Paths ? Should it be checked/unchecked in an ideal scenario ?

 

3. There is another configuration "DAM Safe Binary Filter" which adds content disposition attachment for certain paths/content types. It previously had the text/plain included in the blacklisted mime types. Even removing that did not solve the problem.

 

rohangargTA_2-1659685778145.png

 

Thanks,

Rohan Garg

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, 

Please check this https://experienceleague.adobe.com/docs/experience-manager-64/administering/security/content-disposi....

 

If I were you I would be doing this at apache layer and removing the content disposable header

<LocationMatch ^/content/dam/myprject/robots.txt$>
Header unset Content-Disposition
</LocationMatch>


Arun Patidar

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hi, 

Please check this https://experienceleague.adobe.com/docs/experience-manager-64/administering/security/content-disposi....

 

If I were you I would be doing this at apache layer and removing the content disposable header

<LocationMatch ^/content/dam/myprject/robots.txt$>
Header unset Content-Disposition
</LocationMatch>


Arun Patidar

Avatar

Community Advisor

Thank you @arunpatidar, The redirection and header setting is already handled in dispatcher.

However, if we just look at it from publish instance's point of view can you help with why despite specifying the path in excluded resource path is the file still downloading when "Enabled for all resources" is checked.

Avatar

Community Advisor

Hi,

Probably try restarting the service, It is just a filter so you can debug also in local or add a logger, to check what exactly happening?



Arun Patidar

Avatar

Community Advisor

Hi,

 

It would be good if you handle opening of robots.txt file in browser at apache level. Add inline as content-disposition in domain vhost file with rewrite rule for robots.txt

 

RewriteRule ^/robots.txt$ /content/dam/abc/robots.txt [PT,L]
<LocationMatch "\.(?i:xml|txt)$">
Header set Content-Disposition inline
</LocationMatch>

For Sling content distribution handling here 

https://experienceleague.adobe.com/docs/experience-manager-64/administering/security/content-disposi...

Avatar

Community Advisor

Hi @HeenaMadan , thanks for your response - from overall architecture yes its best if dispatcher handles this.

However, just from publish's point of view any idea why the excluded resource path is not working when "enabled for all resources" is checked ?