Skip to content

[BUGFIX] Ensure toolbox PDF download links exclusively target PDF files - #2190

Draft
beatrycze-volk wants to merge 1 commit into
kitodo:mainfrom
beatrycze-volk:pdf-download
Draft

beatrycze-volk wants to merge 1 commit into
kitodo:mainfrom
beatrycze-volk:pdf-download

Conversation

@beatrycze-volk

Copy link
Copy Markdown
Collaborator

Adds a MIME type check to getPageLink() and getWorkLink() to guarantee that only application/pdf files are offered for download. This prevents generating download links for non-PDF files when a PDF is intended.

Also refines warning messages and return values when no suitable PDF is found.

@beatrycze-volk beatrycze-volk self-assigned this Oct 5, 2026
@beatrycze-volk beatrycze-volk added the ☇ bug A non-security related bug. label Oct 5, 2026
@beatrycze-volk
beatrycze-volk force-pushed the pdf-download branch 2 times, most recently from ac5eff9 to 1379368 Compare October 5, 2026 13:26
@sebastian-meyer

Copy link
Copy Markdown
Member

What is the reason for restricting downloads to PDF files? What's wrong with allowing any file format in the DOWNLOAD file group?

Adds a MIME type check to `getPageLink()` and `getWorkLink()` to guarantee that only `application/pdf` files are offered for download. This prevents generating download links for non-PDF files when a PDF is intended.

Also refines warning messages and return values when no suitable PDF is found.
@beatrycze-volk

Copy link
Copy Markdown
Collaborator Author

What is the reason for restricting downloads to PDF files? What's wrong with allowing any file format in the DOWNLOAD file group?

Restriction is introduced into PDF download tool. Currently this tool displays also images, what creates situation where image download tool gives link for an image and PDF download tool gives link for download linked to the same image file.

@beatrycze-volk
beatrycze-volk marked this pull request as draft October 6, 2026 12:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☇ bug A non-security related bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants