Skip to content

fix: restrict PDF preview to PDF content type#140

Merged
overtrue merged 1 commit into
mainfrom
overtrue/fix-pdf-preview-content-type
Jun 26, 2026
Merged

fix: restrict PDF preview to PDF content type#140
overtrue merged 1 commit into
mainfrom
overtrue/fix-pdf-preview-content-type

Conversation

@overtrue

Copy link
Copy Markdown
Collaborator

Pull Request

Description

Restricts the PDF viewer to objects served as application/pdf so extension-only .pdf matches fall back to the sandboxed preview path.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
CI=true pnpm install --frozen-lockfile
node --test tests/lib/object-preview-source.test.js
pnpm lint
pnpm type-check
pnpm format:check

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

None

Screenshots (if applicable)

None

Additional Notes

None

@overtrue overtrue merged commit 49630dc into main Jun 26, 2026
9 checks passed
@overtrue overtrue deleted the overtrue/fix-pdf-preview-content-type branch June 26, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant