Repository navigation
fix(backoffice): comprobar las subidas por su contenido y limitar las descargas - #22
Merged
bpstack merged 1 commit intoOct 12, 2026
Conversation
…nloads - Invoice PDFs and stamp or signature images go through middlewares/backofficeUpload.ts: the declared type and the first bytes must match (PDF; PNG or WebP), and a file over 10 MB answers 413 with BACKOFFICE_FILE_TOO_LARGE instead of 500. - The controller drops its own type and size checks, now unreachable. - fetchStoredFile stops at 20 MB (maxContentLength); redirects were already refused. - isPdfBuffer moves from the F&B parser to services/uploads/pdf-signature.ts so both modules share it. - Tests: real multipart requests for both uploads, and the axios options of fetchStoredFile. Why: any file declared as application/pdf reached Cloudinary, the multer size error reached the global handler as a 500, and the ZIP of up to 100 validated invoices downloaded each one without a size limit (TODO "subidas y descargas sin comprobar contenido ni tamaño").
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
Cambios
Por qué
Se podía subir como PDF un fichero que no lo era, y el ZIP no tenía límite.