Enforce viewable MIME types config on PDF documents
Summary:
Let instance admins decide whether to allow PDFs to be viewable as a Web page. See https://github.com/mozilla-conduit/phabricator/commit/5ec132bf9ebfb90558f1b7f646772176629f86d0.
MOZILLA: Instead of always allowing PDFs to be viewable in the web UI, [...] This checks that the PDF mimetype is viewable according to the system configuration.
Ref Q83.
Test Plan:
- Set files.viewable-mime-types to exclude application/pdf.
- Upload a pdf file.
- See "No document engine can render the contents of this file." in web UI.
Reviewers: O1 Blessed Committers, speck
Reviewed By: O1 Blessed Committers, speck
Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Differential Revision: https://we.phorge.it/D25464