Repository navigation
fix(attachments): preview PDFs with generic MIME type - #14042
Draft
PsyCrow-code wants to merge 6 commits into
Draft
PsyCrow-code wants to merge 6 commits into
PsyCrow-code wants to merge 6 commits into
Conversation
|
Thanks for opening your first pull request in this repository! ✌️ |
Signed-off-by: PsyCrow <ing.josegonzalez@gmail.com>
Signed-off-by: PsyCrow <ing.josegonzalez@gmail.com>
Signed-off-by: PsyCrow <ing.josegonzalez@gmail.com>
Signed-off-by: PsyCrow <ing.josegonzalez@gmail.com>
Signed-off-by: PsyCrow <ing.josegonzalez@gmail.com>
Signed-off-by: PsyCrow <ing.josegonzalez@gmail.com>
PsyCrow-code
force-pushed
the
feature/pdf-preview-upstream-main
branch
from
November 4, 2026 19:20
52c892e to
9403d26
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #12934.
Some mail senders label PDF attachments as
application/octet-stream, even though their filenames end in.pdfor.PDF. Nextcloud Mail then displays a generic attachment icon and does not offer the PDF viewer.This change enables previews for these specific attachments without changing their declared MIME type or normal download behavior.
Changes
files_pdfviewerhandler forapplication/octet-streamattachments with a case-insensitive.pdffilename extension.%PDF-signature server-side. Reject invalid candidates with HTTP 415 and show a native Nextcloud error notification instead of opening the viewer.Performance and limitations
%PDF-check confirms only the file signature, not that the complete file is a structurally valid or safe PDF. Parsing and rendering remain the viewer's responsibility.files_pdfviewer; normal downloads are unaffected.Testing
upstream/main(6.0.0-alpha.1).upstream/main.php -lpassed for the four changed PHP source/test files.git diff --check upstream/main...HEADpassed.The separately developed local multiline message-list customization is not included.
AI assistance