Sync: dev to main - #381
Open
github-actions[bot] wants to merge 3 commits into
Open
Conversation
The edge proxy sent X-Frame-Options: DENY on /api/resume, so Chrome's PDF viewer reported a failed load for a file that was already on disk. Preview now fetches the PDF as a blob, and uploads keep the original bytes instead of a pdf-lib rewrite that can corrupt real resumes. Co-authored-by: Aamogh <aamoghS@users.noreply.github.com>
Force the blob to application/pdf, reject non-PDF bodies, and add an Open-in-new-tab path so Chrome's viewer is not the only way to see a stored resume. Co-authored-by: Aamogh <aamoghS@users.noreply.github.com>
…sues-9d3d Fix resume preview failing to load in the browser
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.
Automated PR tracking changes from
devintomain.Note
Medium Risk
Changes resume upload persistence and site-wide framing/CSP headers; scope is limited to resume UX but affects how PDFs are stored and how same-origin embedding is allowed.
Overview
Fixes broken resume previews on settings and admin resume book by introducing
ResumePreview, which fetches the PDF with credentials, validates bytes, forcesapplication/pdf, and embeds a blob URL in an iframe instead of framing/api/resume/...directly. Both surfaces also get an Open link to the API URL in a new tab, with loading and error states (including fallback open link).Upload behavior changes: resume POST still parses with pdf-lib to reject unreadable files, but stores the uploaded bytes unchanged—dropping the optional pdf-lib re-save that could shrink text PDFs but often broke forms/fonts in real files.
Security policy alignment: proxy
X-Frame-Optionsmoves fromDENYtoSAMEORIGIN, and CSP addsblob:toframe-srcand relaxesobject-srcto'self' blob:so Chrome’s PDF viewer keeps working when CSP enforcement is turned on.Reviewed by Cursor Bugbot for commit 34dc55c. Bugbot is set up for automated code reviews on this repo. Configure here.