Skip to content

Send Content-Type: application/pdf for PDF downloads - #247

Merged
zackkatz merged 1 commit into
developfrom
fix/pdf-content-type
Aug 18, 2026
Merged

Send Content-Type: application/pdf for PDF downloads#247
zackkatz merged 1 commit into
developfrom
fix/pdf-content-type

Conversation

@zackkatz

@zackkatz zackkatz commented Aug 18, 2026

Copy link
Copy Markdown
Member

The download endpoint sets an explicit Content-Type for xlsx and csv but not pdf, so PDF exports are served as PHP's default text/html; charset=UTF-8 under a .pdf filename. The bytes are a valid PDF (%PDF-1.4 … %%EOF) so sniffing browsers cope, but anything trusting the header — proxies, inline previewers, strict HTTP clients — mishandles the file.

One-line addition to the extension switch in AbstractPHPExcelRenderer::renderOutput().

Found during demo QA (Linear MAR-104: "PDF download returns Content-Type: text/html under a .pdf filename").

💾 Build file (de4133f).

The download endpoint set an explicit Content-Type for xlsx and csv but not
pdf, so PDF exports went out as PHP's default text/html under a .pdf filename.
The bytes are a valid PDF, so browsers that sniff cope, but anything trusting
the header (proxies, previewers, strict clients) mishandles the file.
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 40 minutes

Limit details: You’ve used all 3 included reviews currently available. Your 47 included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52ee032c-30a2-4039-b85e-4c5a15343430

📥 Commits

Reviewing files that changed from the base of the PR and between e287bf2 and de4133f.

📒 Files selected for processing (1)
  • src/Renderer/AbstractPHPExcelRenderer.php

Comment @coderabbitai help to get the list of available commands.

@zackkatz
zackkatz merged commit 315734b into develop Aug 18, 2026
5 checks passed
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