Skip to content

feat(upload): add request body size limits and schema validation#681

Open
victorisiguzoruzoma874 wants to merge 1 commit into
StellerCraft:mainfrom
victorisiguzoruzoma874:feat/issue-071-upload-size-schema-validation
Open

feat(upload): add request body size limits and schema validation#681
victorisiguzoruzoma874 wants to merge 1 commit into
StellerCraft:mainfrom
victorisiguzoruzoma874:feat/issue-071-upload-size-schema-validation

Conversation

@victorisiguzoruzoma874
Copy link
Copy Markdown

@victorisiguzoruzoma874 victorisiguzoruzoma874 commented May 27, 2026

Summary

  • Add validateRequestSize utility to check content-length before buffering
  • Implement schema validation for upload metadata with strict constraints
  • Reject oversized requests with 413 Payload Too Large
  • Reject malformed metadata with 400 Bad Request
  • Document upload size and format constraints

Implementation Details

  • Size limit: 5MB for branding files (checked early before buffering)
  • Metadata fields: filename (255 chars), description (1000 chars), tags (max 20), category (enum)
  • Clear, actionable error messages for validation failures
  • Full test coverage for both size and schema validation

closes #607

🤖 Generated with Claude Code

- Add validateRequestSize utility to check content-length before buffering
- Implement schema validation for upload metadata with strict constraints
- Add support for optional metadata fields: filename, description, tags, category
- Reject oversized requests with 413 Payload Too Large
- Reject malformed metadata with 400 Bad Request and detailed errors
- Add comprehensive test coverage for size and schema validation
- Document upload constraints in endpoint JSDoc

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@victorisiguzoruzoma874 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Implement Request Body Size Limits and Schema Validation for Upload Endpoints

1 participant