Configurable headers for wagtail documents
See original GitHub issueIt seems Content-Disposition
header is always set to ‘attachments’ https://github.com/torchbox/wagtail/blob/v0.8.7/wagtail/wagtaildocs/views/serve.py#L16 which results in browsers prompting users to download the file.
Since modern browsers can easily display PDF files, it would be great if we could make above header configurable.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Settings — Wagtail Documentation 4.1.1 documentation
Customise Wagtail's behaviour when an internal page url is entered in the external link chooser. Possible values for this setting are 'all' ,...
Read more >Adding custom HTTP headers to Wagtail pages
My issue was that I wasn't aware the module path relates directly to the filename. The following middleware creates and adds the header...
Read more >Deploying Wagtail — Wagtail 2.2.2 documentation
You are not reading the most recent version of this documentation. v4.1.1 is the ... you'll need to ensure that it is configured...
Read more >Installation — wagtail-cache 2.2 documentation
Next a cache must be configured in the settings. ... gives you the option to add a custom Cache-Control header via cache_control ,...
Read more >Wagtail Documentation
Various other settings are available to configure Wagtail's behaviour - see Configuring ... hosted font files that lack a valid header.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ran into this on a couple of client sites, specifically related to PDF documents not being previewable.
Here’s a workaround that overrides Wagtail’s default document view and redirects to the file URL:
Then add this to the top of your urlpatterns (above any wagtail includes):
So, any news on this issue. It seams still that pdf’s inserted in RicheText or Stream Fields are served as Content-Type: application/octet-stream and Content-Disposition: attachment; and so downloaded instead of displayed in the browser. Any way yet to affect this behavior?