Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This description of Content-Disposition configuration is not clear #449

Open
johnb4 opened this issue Sep 7, 2023 · 4 comments
Open

This description of Content-Disposition configuration is not clear #449

johnb4 opened this issue Sep 7, 2023 · 4 comments
Labels
Enhancement A suggestion for an improvement or expansion to the existing docs Tracked Issue has been triaged and transferred to AdobeDocs Jira

Comments

@johnb4
Copy link

johnb4 commented Sep 7, 2023

Issue in ./help/sites-administering/content-disposition-filter.md

There are two OSGi configurations that affect the "Content-Disposition" response header in AEM. This doc only mentions one of them, namely "Apache Sling Content Disposition Filter" (org.apache.sling.security.impl.ContentDispositionFilter). The description of the fields for this config is not clear. Here's a more precise definition (from Jira GRANITE-34680):

The Included Resource Paths & Content Types configuration is used to list the content on which this filter will be applied, i.e filter will block the access.
And if Enable For All Resource Paths flag is true, the filter will be applied to all resources except resource paths mentioned in Excluded Resource Paths configuration ignoring anything present in Included Resource Paths & Content Types.

So, If you want a PDF to be opened in the browser inline, that PDF's absolute path should be added in the Excluded Resource Paths configuration.

The other OSGi configuration that affects Content-Disposition is "Dam Safe Binary Filter" (com.day.cq.dam.core.impl.servlet.DamContentDispositionFilter). This config defines the mimetypes served with the response header "Content-Disposition: attachment". The first one Blacklisted Mime Types really means "Set Content-Disposition response header to 'attachment' for these mime types". It has the default values "text/html", "application/octet-stream", and "image/svg+xml". The second one (Allow unknown mime types), the checkbox, can be interpreted as: If there is no mime type defined on the asset, then (1) if enabled, set Content-Disposition = inline, (2) if disabled, set Content-Disposition = attachment.

If you have a static HTML asset that you have stored in the DAM and desire that .html file to be rendered inline and not downloaded as an attachment, the Enable For All Resource Paths checkbox needs to be disabled (unchecked) in the "Apache Sling Content Disposition Filter" config and the value "text/html" needs to removed from the list of Blacklisted Mime Types in the "Dam Safe Binary Filter" config.

@johnb4
Copy link
Author

johnb4 commented Sep 7, 2023

If you want a pdf to be opened in the browser inline, that pdf's absolute path should be added in the Excluded Resource Paths configuration, appended with "/jcr:content/renditions/original". An example: "/content/dam/folder1/file-xyz.pdf/jcr:content/renditions/original"

@anujkapo
Copy link
Contributor

anujkapo commented Sep 9, 2023

Thanks, @johnb4. We will look into it.

@anujkapo
Copy link
Contributor

anujkapo commented Sep 9, 2023

@adobe export issue to Jira project CQDOC

@github-jira-sync-bot
Copy link
Collaborator

✅ Jira issue CQDOC-20810 is successfully created for this GitHub issue.

@anujkapo anujkapo added Tracked Issue has been triaged and transferred to AdobeDocs Jira Enhancement A suggestion for an improvement or expansion to the existing docs labels Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A suggestion for an improvement or expansion to the existing docs Tracked Issue has been triaged and transferred to AdobeDocs Jira
Projects
None yet
Development

No branches or pull requests

3 participants